aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-05-11 20:05:04 +0100
committerJon Leighton <j@jonathanleighton.com>2012-05-11 20:11:04 +0100
commitecef5a9f224ad3ac74c0466b33cef0226ec0787c (patch)
treec9ce02211c4af184ebd78d40cc93b5d902819e8e
parentbe7c6ee56d40b2205cb071b8d616191eac292ce8 (diff)
downloadrails-ecef5a9f224ad3ac74c0466b33cef0226ec0787c.tar.gz
rails-ecef5a9f224ad3ac74c0466b33cef0226ec0787c.tar.bz2
rails-ecef5a9f224ad3ac74c0466b33cef0226ec0787c.zip
this stuff can all be handled by Relation
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb38
1 files changed, 0 insertions, 38 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index 96911d1d79..b3e46d3707 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -75,31 +75,6 @@ module ActiveRecord
end
end
- def respond_to?(name, include_private = false)
- super ||
- (load_target && target.respond_to?(name, include_private)) ||
- proxy_association.klass.respond_to?(name, include_private)
- end
-
- def method_missing(method, *args, &block)
- if target.respond_to?(method) || (!proxy_association.klass.respond_to?(method) && Class.respond_to?(method))
- if load_target
- if target.respond_to?(method)
- target.send(method, *args, &block)
- else
- begin
- super
- rescue NoMethodError => e
- raise e, e.message.sub(/ for #<.*$/, " via proxy for #{target}")
- end
- end
- end
-
- else
- super
- end
- end
-
def ==(other)
load_target == other
end
@@ -129,19 +104,6 @@ module ActiveRecord
proxy_association.reload
self
end
-
- # Define array public methods because we know it should be invoked over
- # the target, so we can have a performance improvement using those methods
- # in association collections
- Array.public_instance_methods.each do |m|
- unless method_defined?(m)
- class_eval <<-RUBY, __FILE__, __LINE__ + 1
- def #{m}(*args, &block)
- target.public_send(:#{m}, *args, &block) if load_target
- end
- RUBY
- end
- end
end
end
end