This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/query_memcached.rb b/lib/query_memcached.rb | |
| index c911388..715c47d 100644 | |
| --- a/lib/query_memcached.rb | |
| +++ b/lib/query_memcached.rb | |
| @@ -88,6 +88,7 @@ module ActiveRecord | |
| end | |
| +if ActiveRecord::ConnectionAdapters.const_defined?( 'PostgreSQLAdapter' ) | |
| class PostgreSQLAdapter < AbstractAdapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Returns the path to the rails/init.rb file for the given extension, | |
| # or nil if no gem provides it. | |
| def init_path_for_extension(extension) | |
| return if extension.blank? | |
| return unless spec = Gem.searcher.find(extension.to_s) | |
| returning File.join(spec.full_gem_path, 'rails', 'init.rb') do |path| | |
| return unless File.file?(path) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| assert_raise(FiberError){ | |
| Fiber.yield | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ExceptionNotifier.exception_recipients = %w(you@yourdomain.com) | |
| ExceptionNotifier.class_eval do | |
| remove_method :template_root | |
| ExceptionNotifier.template_root = "#{RAILS_ROOT}/vendor/plugins/exception_notification/lib/../views" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delivers a TMail::Mail object. By default, it delivers the cached mail | |
| # object (from the <tt>create!</tt> method). If no cached mail object exists, and | |
| # no alternate has been given as the parameter, this will fail. | |
| def deliver!(mail = @mail) | |
| raise "no mail object available for delivery!" unless mail | |
| unless logger.nil? | |
| logger.info "Sent mail to #{Array(recipients).join(', ')}" | |
| logger.debug "\n#{mail.encoded}" | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RouteFilter | |
| class << self | |
| def routes | |
| ActionController::Routing::Routes.routes | |
| end | |
| def controllers | |
| ::Object.subclasses_of( ::ActionController::Base ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActiveResource | |
| class Base | |
| protected | |
| alias :original_create :create | |
| def create( attributes = {} ) | |
| self.attributes = attributes | |
| original_create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Class | |
| def publicize_methods! | |
| hidden_methods = self.private_instance_methods + self.protected_instance_methods | |
| self.class_eval { public *hidden_methods } | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'activesupport' | |
| z = returning( "" ) do |html| | |
| html += "stuff" | |
| html += "more stuff" if true | |
| end | |
| z = returning( [] ) do |html| | |
| html << "stuff" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #abstract/database_statements.rb | |
| # Returns the last auto-generated ID from the affected table. | |
| def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) | |
| execute(sql, name) | |
| id_value | |
| end | |
| #mysql_adapter.rb | |