diff options
author | Paul McMahon <paul@mobalean.com> | 2012-01-31 09:32:42 +0900 |
---|---|---|
committer | Paul McMahon <paul@mobalean.com> | 2012-01-31 09:32:42 +0900 |
commit | b08bf9979232f40309a826947f8ff85d8ccbaa8a (patch) | |
tree | 9a85a9d03c24085133823c11c40f4ac74115efc6 | |
parent | 2352b50e71d3165128317c7927eb0163d87ba992 (diff) | |
download | rails-b08bf9979232f40309a826947f8ff85d8ccbaa8a.tar.gz rails-b08bf9979232f40309a826947f8ff85d8ccbaa8a.tar.bz2 rails-b08bf9979232f40309a826947f8ff85d8ccbaa8a.zip |
Use conditional instead of try
-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) |