diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-20 01:29:18 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-20 01:29:18 +0530 |
commit | 1b78a3f8d5417708eb7040cc00722494eaa6a2b5 (patch) | |
tree | 8357f1c43ecf489b0d28cb05d354d534a373d6cd | |
parent | 42553a98eaa05c703de52147c870e4dd9a3d50ba (diff) | |
download | rails-1b78a3f8d5417708eb7040cc00722494eaa6a2b5.tar.gz rails-1b78a3f8d5417708eb7040cc00722494eaa6a2b5.tar.bz2 rails-1b78a3f8d5417708eb7040cc00722494eaa6a2b5.zip |
with_scope no longer needs :reverse_merge
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index e10df1abd3..c20a14551e 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1763,11 +1763,8 @@ module ActiveRecord #:nodoc: relation = construct_finder_arel(method_scoping[:find] || {}) if current_scoped_methods && current_scoped_methods.create_with_value && method_scoping[:create] - scope_for_create = case action - when :merge + scope_for_create = if action == :merge current_scoped_methods.create_with_value.merge(method_scoping[:create]) - when :reverse_merge - method_scoping[:create].merge(current_scoped_methods.create_with_value) else method_scoping[:create] end @@ -1782,15 +1779,7 @@ module ActiveRecord #:nodoc: method_scoping = relation end - if current_scoped_methods - case action - when :merge - method_scoping = current_scoped_methods.merge(method_scoping) - when :reverse_merge - method_scoping = current_scoped_methods.except(:where).merge(method_scoping) - method_scoping = method_scoping.merge(current_scoped_methods.only(:where)) - end - end + method_scoping = current_scoped_methods.merge(method_scoping) if current_scoped_methods && action == :merge self.scoped_methods << method_scoping begin |