From 4bd8d2607ce0078dad3f57964ca70628b2d001a2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 22 Feb 2011 11:07:09 -0800 Subject: Relation will delegate to AR::Base which already uses the Dynamic finders, so eliminate duplicate calls --- activerecord/lib/active_record/relation.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3