Permalink
Browse files

Use conditional instead of try

  • Loading branch information...
1 parent 2352b50 commit b08bf9979232f40309a826947f8ff85d8ccbaa8a @pwim pwim committed Jan 31, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/dynamic_finder_match.rb
@@ -10,7 +10,7 @@ def self.match(method)
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)

0 comments on commit b08bf99

Please sign in to comment.