提交 eb83c9cf 编写于 作者: C Carl Lerche

Merge remote branch 'spastorino/master'

...@@ -63,8 +63,9 @@ def cache_configured? ...@@ -63,8 +63,9 @@ def cache_configured?
included do included do
extend ConfigMethods extend ConfigMethods
@@perform_caching = true delegate :perform_caching, :perform_caching=, :to => :config
cattr_accessor :perform_caching singleton_class.delegate :perform_caching, :perform_caching=, :to => :config
self.perform_caching = true
end end
......
require 'active_support/core_ext/hash/conversions.rb'
require 'action_dispatch/http/request' require 'action_dispatch/http/request'
module ActionDispatch module ActionDispatch
......
...@@ -39,7 +39,7 @@ def cache(name = {}, options = nil, &block) ...@@ -39,7 +39,7 @@ def cache(name = {}, options = nil, &block)
private private
# TODO: Create an object that has caching read/write on it # TODO: Create an object that has caching read/write on it
def fragment_for(name = {}, options = nil, &block) #:nodoc: def fragment_for(name = {}, options = nil, &block) #:nodoc:
if controller.class.perform_caching if controller.perform_caching
if controller.fragment_exist?(name, options) if controller.fragment_exist?(name, options)
controller.read_fragment(name, options) controller.read_fragment(name, options)
else else
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
require 'models/author' require 'models/author'
require 'models/tagging' require 'models/tagging'
require 'models/comment' require 'models/comment'
require 'models/company_in_module'
class XmlSerializationTest < ActiveRecord::TestCase class XmlSerializationTest < ActiveRecord::TestCase
def test_should_serialize_default_root def test_should_serialize_default_root
......
require 'benchmark' require 'benchmark'
class << 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 def ms
1000 * realtime { yield } 1000 * realtime { yield }
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册