diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/dynamic_finder_match.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/dynamic_finder_match.rb b/activerecord/lib/active_record/dynamic_finder_match.rb index 638b68bc52..e266fbb2e9 100644 --- a/activerecord/lib/active_record/dynamic_finder_match.rb +++ b/activerecord/lib/active_record/dynamic_finder_match.rb @@ -10,7 +10,7 @@ module ActiveRecord klass = [FindBy, FindByBang, FindOrInitializeCreateBy].find do |klass| klass.matches?(method) end - klass.try(:new, method) + klass.new(method) if klass end def self.matches?(method) |