From 4309c1fda3d778b16569b74a7d86ec19b5e994a3 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 17 Apr 2010 19:08:49 -0300 Subject: [PATCH 1/5] perform_caching is now delegated to config on instance and class level --- actionpack/lib/action_controller/caching.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 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 From 9c4ac84e495c1476758aa8bcc764f6c1a935f404 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 17 Apr 2010 19:10:10 -0300 Subject: [PATCH 2/5] perform_caching should be accessed through the controller here --- actionpack/lib/action_view/helpers/cache_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c4846c99c51a33bd66933dd0fd5dacfac99fb9de Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 18 Apr 2010 00:12:08 -0300 Subject: [PATCH 3/5] Missing require added --- activerecord/test/cases/xml_serialization_test.rb | 1 + 1 file changed, 1 insertion(+) 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 From b7ea64a86c03becdbdd417cc79cc1d2ad20a30bc Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 18 Apr 2010 03:46:01 -0300 Subject: [PATCH 4/5] remove code for Ruby < 1.8.7 --- .../lib/active_support/core_ext/benchmark.rb | 12 ------------ 1 file changed, 12 deletions(-) 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 From 978c80d6e347b060dc11ee666c8a3a61fc9408a4 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 18 Apr 2010 14:02:46 -0300 Subject: [PATCH 5/5] Missing require added --- actionpack/lib/action_dispatch/middleware/params_parser.rb | 1 + 1 file changed, 1 insertion(+) 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