diff options
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index bfd9daf803..d05e3c6cae 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -990,8 +990,15 @@ module ActiveRecord #:nodoc: conditions = construct_conditions_from_arguments(attribute_names, arguments) - if arguments[attribute_names.length].is_a?(Hash) - find(finder, { :conditions => conditions }.update(arguments[attribute_names.length])) + if (extra_options = arguments[attribute_names.size]).is_a?(Hash) + finder_options = extra_options.merge(:conditions => conditions) + if extra_options[:conditions] + with_scope(:find => {:conditions => extra_options[:conditions]}) do + find(finder, finder_options) + end + else + find(finder, finder_options) + end else send("find_#{finder}", conditions, *arguments[attribute_names.length..-1]) # deprecated API end |