aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/caching.rb5
-rw-r--r--actionpack/lib/action_dispatch/middleware/params_parser.rb1
-rw-r--r--actionpack/lib/action_view/helpers/cache_helper.rb2
-rw-r--r--activerecord/test/cases/xml_serialization_test.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/benchmark.rb12
5 files changed, 6 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index b3fa129929..0da0ca1893 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -63,8 +63,9 @@ module ActionController #:nodoc:
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 1524b00d5b..09fb1f998a 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 9c6fc752e5..a904af56bb 100644
--- a/actionpack/lib/action_view/helpers/cache_helper.rb
+++ b/actionpack/lib/action_view/helpers/cache_helper.rb
@@ -39,7 +39,7 @@ module ActionView
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 f5a18827d8..b1c75ec8cd 100644
--- a/activerecord/test/cases/xml_serialization_test.rb
+++ b/activerecord/test/cases/xml_serialization_test.rb
@@ -4,6 +4,7 @@ require 'models/post'
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 ae57b152e8..2d110155a5 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