aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorTAKAHASHI Kazuaki <dia@dmap.tk>2015-03-27 20:10:57 +0900
committerTAKAHASHI Kazuaki <dia@dmap.tk>2015-03-27 20:10:57 +0900
commitc6e05d68400361921c4ba6f0888979e92a4a801b (patch)
tree64224106fb4b7ae9928b147e993a7e127d31a276 /activerecord/lib/active_record
parent3f28378cbde3528225d717c1bb1dcbdb9d093b34 (diff)
downloadrails-c6e05d68400361921c4ba6f0888979e92a4a801b.tar.gz
rails-c6e05d68400361921c4ba6f0888979e92a4a801b.tar.bz2
rails-c6e05d68400361921c4ba6f0888979e92a4a801b.zip
Fix unscope for less than
Code such as the following will be corrected. Developer.where(id: -Float::INFINITY...2).unscope(where: :id)
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/where_clause.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb
index f9b9e640ec..1f000b3f0f 100644
--- a/activerecord/lib/active_record/relation/where_clause.rb
+++ b/activerecord/lib/active_record/relation/where_clause.rb
@@ -135,7 +135,7 @@ module ActiveRecord
def predicates_except(columns)
predicates.reject do |node|
case node
- when Arel::Nodes::Between, Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual, Arel::Nodes::LessThanOrEqual, Arel::Nodes::GreaterThanOrEqual
+ when Arel::Nodes::Between, Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual, Arel::Nodes::LessThan, Arel::Nodes::LessThanOrEqual, Arel::Nodes::GreaterThan, Arel::Nodes::GreaterThanOrEqual
subrelation = (node.left.kind_of?(Arel::Attributes::Attribute) ? node.left : node.right)
columns.include?(subrelation.name.to_s)
end