diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-09-30 23:29:23 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-09-30 23:29:23 +0100 |
commit | 704961ce688f5bc1942529f44ea6b00014ef8378 (patch) | |
tree | b951112aed4914cdc4203bca6e810a7b71d37e82 /activerecord/lib/active_record/relation.rb | |
parent | b689834bcf2730353d066277f43047f10abb8d30 (diff) | |
parent | 91deff08c940f16ed149e7628694faff0393fe0a (diff) | |
download | rails-704961ce688f5bc1942529f44ea6b00014ef8378.tar.gz rails-704961ce688f5bc1942529f44ea6b00014ef8378.tar.bz2 rails-704961ce688f5bc1942529f44ea6b00014ef8378.zip |
Merge branch 'master' into nested_has_many_through_2
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 478f1e8ef1..04ba5b291e 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -326,7 +326,11 @@ module ActiveRecord def scope_for_create @scope_for_create ||= begin - @create_with_value || where_values_hash + if @create_with_value + @create_with_value.reverse_merge(where_values_hash) + else + where_values_hash + end end end @@ -358,15 +362,6 @@ module ActiveRecord scoping { @klass.send(method, *args, &block) } elsif arel.respond_to?(method) arel.send(method, *args, &block) - elsif match = DynamicFinderMatch.match(method) - attributes = match.attribute_names - super unless @klass.send(:all_attributes_exists?, attributes) - - if match.finder? - find_by_attributes(match, attributes, *args) - elsif match.instantiator? - find_or_instantiator_by_attributes(match, attributes, *args, &block) - end else super end |