diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-01-27 01:28:54 -0800 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-01-27 01:28:54 -0800 |
commit | f22a0e2f1d55af4c16abbe29158d190053374a76 (patch) | |
tree | 9684e375449045e8c458f622227e89e8172542ed /activerecord/lib | |
parent | faaf694e0f94f422b34774a18b94632baad47bc2 (diff) | |
parent | 7b9baeed7cbcd896bbd4345ce3d9e95fb51ecb99 (diff) | |
download | rails-f22a0e2f1d55af4c16abbe29158d190053374a76.tar.gz rails-f22a0e2f1d55af4c16abbe29158d190053374a76.tar.bz2 rails-f22a0e2f1d55af4c16abbe29158d190053374a76.zip |
Merge pull request #4715 from pwim/find-create-multi-args
Fix regression from Rails 3.1
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/dynamic_matchers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/dynamic_matchers.rb b/activerecord/lib/active_record/dynamic_matchers.rb index e9068089f0..b6b8e24436 100644 --- a/activerecord/lib/active_record/dynamic_matchers.rb +++ b/activerecord/lib/active_record/dynamic_matchers.rb @@ -25,7 +25,7 @@ module ActiveRecord if match = (DynamicFinderMatch.match(method_id) || DynamicScopeMatch.match(method_id)) attribute_names = match.attribute_names super unless all_attributes_exists?(attribute_names) - if arguments.size < attribute_names.size + if !(match.is_a?(DynamicFinderMatch) && match.instantiator? && arguments.first.is_a?(Hash)) && arguments.size < attribute_names.size method_trace = "#{__FILE__}:#{__LINE__}:in `#{method_id}'" backtrace = [method_trace] + caller raise ArgumentError, "wrong number of arguments (#{arguments.size} for #{attribute_names.size})", backtrace |