diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index b3fa129929a56da49368ad60b15df781d8974550..0da0ca18931522e93b822c1373524c1165ab4bb1 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -63,8 +63,9 @@ def cache_configured? included do extend ConfigMethods - @@perform_caching = true - cattr_accessor :perform_caching + delegate :perform_caching, :perform_caching=, :to => :config + singleton_class.delegate :perform_caching, :perform_caching=, :to => :config + self.perform_caching = true end diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index 1524b00d5bafeb5c7179022ce8b4173e9fbec1ff..09fb1f998a85d4b3bcbc01d49373d9a68b114f7d 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -1,3 +1,4 @@ +require 'active_support/core_ext/hash/conversions.rb' require 'action_dispatch/http/request' module ActionDispatch diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 9c6fc752e5ceda672cf5340b696476353d66bf6c..a904af56bba7631644b2d21c461c9b7abadfdbfe 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -39,7 +39,7 @@ def cache(name = {}, options = nil, &block) private # TODO: Create an object that has caching read/write on it def fragment_for(name = {}, options = nil, &block) #:nodoc: - if controller.class.perform_caching + if controller.perform_caching if controller.fragment_exist?(name, options) controller.read_fragment(name, options) else diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb index f5a18827d883c8f8bbcd7d18ba782434a2045e81..b1c75ec8cdfa333c61091cdba6684f99433bd6e0 100644 --- a/activerecord/test/cases/xml_serialization_test.rb +++ b/activerecord/test/cases/xml_serialization_test.rb @@ -4,6 +4,7 @@ require 'models/author' require 'models/tagging' require 'models/comment' +require 'models/company_in_module' class XmlSerializationTest < ActiveRecord::TestCase def test_should_serialize_default_root diff --git a/activesupport/lib/active_support/core_ext/benchmark.rb b/activesupport/lib/active_support/core_ext/benchmark.rb index ae57b152e826eb9e891e734db6b646a9c61d60bc..2d110155a5126f6cb7e930675f3bf461231e7fbf 100644 --- a/activesupport/lib/active_support/core_ext/benchmark.rb +++ b/activesupport/lib/active_support/core_ext/benchmark.rb @@ -1,18 +1,6 @@ require 'benchmark' class << Benchmark - # Earlier Ruby had a slower implementation. - if RUBY_VERSION < '1.8.7' - remove_method :realtime - - def realtime - r0 = Time.now - yield - r1 = Time.now - r1.to_f - r0.to_f - end - end - def ms 1000 * realtime { yield } end