diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2011-12-17 14:41:17 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2011-12-17 14:41:17 +0300 |
commit | 04cea56d89e71dbb25dc888d8f855ba18025ccca (patch) | |
tree | f52d503896b7c14b0cd92a2566ef1aea6c94e20c /activerecord/lib | |
parent | 1bfed9efb39f4a8eff2867bb1d8b9e19ecc8ca02 (diff) | |
download | rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.tar.gz rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.tar.bz2 rails-04cea56d89e71dbb25dc888d8f855ba18025ccca.zip |
call scope within unscoped to prevent duplication of where values
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index f7512bbf5f..17122740da 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -177,7 +177,7 @@ module ActiveRecord extension = Module.new(&Proc.new) if block_given? scope_proc = lambda do |*args| - options = scope_options.respond_to?(:call) ? scope_options.call(*args) : scope_options + options = scope_options.respond_to?(:call) ? unscoped { scope_options.call(*args) } : scope_options options = scoped.apply_finder_options(options) if options.is_a?(Hash) relation = scoped.merge(options) |