diff options
author | Steve Hodgkiss <steve@hodgkiss.me.uk> | 2011-06-18 22:30:01 +0100 |
---|---|---|
committer | Steve Hodgkiss <steve@hodgkiss.me.uk> | 2011-06-18 22:30:01 +0100 |
commit | 50444204cc907e3335d113043acabd439639b9e1 (patch) | |
tree | 5290ffa78e1b5b3d4de9e162687995f4ec92ddf2 /activerecord/lib | |
parent | 2fbb7504e2c2b0a95398d1ef0c97ea4a403d831d (diff) | |
download | rails-50444204cc907e3335d113043acabd439639b9e1.tar.gz rails-50444204cc907e3335d113043acabd439639b9e1.tar.bz2 rails-50444204cc907e3335d113043acabd439639b9e1.zip |
Fix inconsistencies by being polite to the wrapped body. Needed for Rack::Sendfile to function properly. See issue #1761.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/query_cache.rb | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index dd1d2d4fba..090f6bc6fe 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -426,6 +426,14 @@ module ActiveRecord @testing = testing end + def method_missing(method_sym, *arguments, &block) + @body.send(method_sym, *arguments, &block) + end + + def respond_to?(method_sym, include_private = false) + super || @body.respond_to?(method_sym) + end + def each(&block) body.each(&block) end diff --git a/activerecord/lib/active_record/query_cache.rb b/activerecord/lib/active_record/query_cache.rb index 4e61671473..e485901440 100644 --- a/activerecord/lib/active_record/query_cache.rb +++ b/activerecord/lib/active_record/query_cache.rb @@ -33,6 +33,14 @@ module ActiveRecord @target = target end + def method_missing(method_sym, *arguments, &block) + @target.send(method_sym, *arguments, &block) + end + + def respond_to?(method_sym, include_private = false) + super || @target.respond_to?(method_sym) + end + def each(&block) @target.each(&block) end |