Skip to content
This repository
Browse code

Use conditional instead of try

  • Loading branch information...
commit b08bf9979232f40309a826947f8ff85d8ccbaa8a 1 parent 2352b50
Paul McMahon authored
2  activerecord/lib/active_record/dynamic_finder_match.rb
@@ -10,7 +10,7 @@ def self.match(method)
10 10
       klass = [FindBy, FindByBang, FindOrInitializeCreateBy].find do |klass|
11 11
         klass.matches?(method)
12 12
       end
13  
-      klass.try(:new, method)
  13
+      klass.new(method) if klass
14 14
     end
15 15
 
16 16
     def self.matches?(method)

0 notes on commit b08bf99

Please sign in to comment.
Something went wrong with that request. Please try again.