mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge remote branch 'spastorino/master'
This commit is contained in:
commit
eb83c9cf42
5 changed files with 6 additions and 15 deletions
|
@ -63,8 +63,9 @@ module ActionController #:nodoc:
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
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 @@ module ActionView
|
||||||
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 @@ require 'models/post'
|
||||||
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
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue