diff options
-rw-r--r-- | activerecord/lib/active_record/dynamic_finder_match.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/dynamic_finder_match.rb b/activerecord/lib/active_record/dynamic_finder_match.rb index 533bc331ae..e8f3f8b560 100644 --- a/activerecord/lib/active_record/dynamic_finder_match.rb +++ b/activerecord/lib/active_record/dynamic_finder_match.rb @@ -6,8 +6,8 @@ module ActiveRecord # class DynamicFinderMatch def self.match(method) - df_match = self.new(method) - df_match.finder ? df_match : nil + df_match = new(method) + df_match.finder && df_match end def initialize(method) @@ -35,11 +35,11 @@ module ActiveRecord attr_reader :finder, :attribute_names, :instantiator def finder? - !@finder.nil? && @instantiator.nil? + @finder && !@instantiator end def instantiator? - @finder == :first && !@instantiator.nil? + @finder == :first && @instantiator end def creator? |