Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7419

Show
Ignore:
Timestamp:
09/08/07 04:31:26 (1 year ago)
Author:
bitsweat
Message:

Explicitly require active_record/query_cache before using it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r7418 r7419  
    11*SVN* 
     2 
     3* Explicitly require active_record/query_cache before using it.  [Jeremy Kemper] 
    24 
    35* Fix layout overriding response status.  #9476 [lotswholetime] 
  • trunk/actionpack/lib/action_controller/caching.rb

    r7403 r7419  
    1313    def self.included(base) #:nodoc: 
    1414      base.send(:include, Pages, Actions, Fragments) 
    15       base.send(:include, Sweeping, SqlCache) if defined?(ActiveRecord) 
     15      if defined?(ActiveRecord) 
     16        require 'active_record/query_cache' 
     17        base.send(:include, Sweeping, SqlCache) 
     18      end 
    1619 
    1720      base.class_eval do 
     
    657660      end 
    658661    end 
    659      
    660     if defined?(ActiveRecord)      
    661       module SqlCache 
    662         def self.included(base) #:nodoc: 
     662 
     663    module SqlCache 
     664      def self.included(base) #:nodoc: 
     665        if defined?(ActiveRecord) && ActiveRecord::Base.respond_to?(:cache) 
    663666          base.alias_method_chain :perform_action, :caching 
    664667        end 
    665          
    666         def perform_action_with_caching 
    667           ActiveRecord::Base.cache do 
    668             perform_action_without_caching 
    669           end 
     668      end 
     669 
     670      def perform_action_with_caching 
     671        ActiveRecord::Base.cache do 
     672          perform_action_without_caching 
    670673        end 
    671674      end 
    672675    end 
    673      
    674676  end 
    675677end 
  • trunk/activerecord/CHANGELOG

    r7410 r7419  
    11*SVN* 
     2 
     3* Explicitly require active_record/query_cache before using it.  [Jeremy Kemper] 
    24 
    35* Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record.  [Rick, marclove] 
  • trunk/activerecord/lib/active_record.rb

    r6833 r7419  
    7676require 'active_record/connection_adapters/abstract_adapter' 
    7777 
    78 require 'active_record/query_cache' 
    7978require 'active_record/schema_dumper' 
  • trunk/activerecord/lib/active_record/query_cache.rb

    r7399 r7419  
    6363        when Array 
    6464          result.collect { |row| row.dup } 
    65         when Numeric, NilClass, FalseClass 
     65        when Fixnum, NilClass, FalseClass 
    6666          result 
    6767        else 
  • trunk/activerecord/test/query_cache_test.rb

    r7399 r7419  
    44require 'fixtures/task' 
    55require 'fixtures/course' 
     6 
     7require 'active_record/query_cache' 
    68 
    79class QueryCacheTest < Test::Unit::TestCase