diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-22 11:07:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-22 11:07:51 -0800 |
commit | 4bd8d2607ce0078dad3f57964ca70628b2d001a2 (patch) | |
tree | 40c911ae9f2ccb5375a7a37567c0f23bb8101607 /activerecord/lib/active_record | |
parent | f8cfa454e540def354c7ad3db62e7995165ea08b (diff) | |
download | rails-4bd8d2607ce0078dad3f57964ca70628b2d001a2.tar.gz rails-4bd8d2607ce0078dad3f57964ca70628b2d001a2.tar.bz2 rails-4bd8d2607ce0078dad3f57964ca70628b2d001a2.zip |
Relation will delegate to AR::Base which already uses the Dynamic finders, so eliminate duplicate calls
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c6cd8891e3..3c7533ea48 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -67,15 +67,10 @@ module ActiveRecord end def respond_to?(method, include_private = false) - return true if arel.respond_to?(method, include_private) || Array.method_defined?(method) || @klass.respond_to?(method, include_private) - - if match = DynamicFinderMatch.match(method) - return true if @klass.send(:all_attributes_exists?, match.attribute_names) - elsif match = DynamicScopeMatch.match(method) - return true if @klass.send(:all_attributes_exists?, match.attribute_names) - else + arel.respond_to?(method, include_private) || + Array.method_defined?(method) || + @klass.respond_to?(method, include_private) || super - end end def to_a |