diff options
author | Eric Hankins <ehankins@rednovalabs.com> | 2013-10-16 13:39:43 -0500 |
---|---|---|
committer | Eric Hankins <ehankins@rednovalabs.com> | 2013-10-21 09:43:57 -0500 |
commit | b05776581747057c162207d0a857c98fa326c11d (patch) | |
tree | 085b954b960d7cc08b915e2f3b14f0ff48505e2e /activerecord/lib | |
parent | 73641563917e3a69b63a1b11c8ebe33c469e8951 (diff) | |
download | rails-b05776581747057c162207d0a857c98fa326c11d.tar.gz rails-b05776581747057c162207d0a857c98fa326c11d.tar.bz2 rails-b05776581747057c162207d0a857c98fa326c11d.zip |
Allow unscope to work with `where.not`
Allows you to call #unscope on a relation with negative equality operators,
i.e. Arel::Nodes::NotIn and Arel::Nodes::NotEqual that have been generated
through the use of where.not.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 9c9690215a..a53f034345 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -856,7 +856,7 @@ module ActiveRecord where_values.reject! do |rel| case rel - when Arel::Nodes::In, Arel::Nodes::Equality + when Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual subrelation = (rel.left.kind_of?(Arel::Attributes::Attribute) ? rel.left : rel.right) subrelation.name.to_sym == target_value_sym else |