diff options
author | bigxiang <bigxiang@gmail.com> | 2014-08-23 21:01:12 +0800 |
---|---|---|
committer | bigxiang <bigxiang@gmail.com> | 2014-08-23 21:01:12 +0800 |
commit | d27bfef96a86e7278dee297a8af3612ebefbe898 (patch) | |
tree | 3933dc67a14bb873b9d292ec1174a5970faafe9a /lib/arel/predications.rb | |
parent | 53bc8426648cc93695525e8f12102cd416b2d772 (diff) | |
download | rails-d27bfef96a86e7278dee297a8af3612ebefbe898.tar.gz rails-d27bfef96a86e7278dee297a8af3612ebefbe898.tar.bz2 rails-d27bfef96a86e7278dee297a8af3612ebefbe898.zip |
Fix lt & lteq don't accept most of values.
Diffstat (limited to 'lib/arel/predications.rb')
-rw-r--r-- | lib/arel/predications.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/arel/predications.rb b/lib/arel/predications.rb index 78cd87d430..1941383068 100644 --- a/lib/arel/predications.rb +++ b/lib/arel/predications.rb @@ -31,7 +31,7 @@ module Arel when Range if other.begin == -Float::INFINITY if other.end == Float::INFINITY - Nodes::NotIn.new self, [] + Nodes::NotIn.new self, [] elsif other.exclude_end? Nodes::LessThan.new(self, Nodes.build_quoted(other.end, self)) else @@ -67,20 +67,20 @@ module Arel Arel::Nodes::NotIn.new(self, other.ast) when Range if other.begin == -Float::INFINITY # The range begins with negative infinity - if other.end == Float::INFINITY + if other.end == Float::INFINITY Nodes::In.new self, [] # The range is infinite, so return an empty range elsif other.exclude_end? Nodes::GreaterThanOrEqual.new(self, Nodes.build_quoted(other.end, self)) else Nodes::GreaterThan.new(self, Nodes.build_quoted(other.end, self)) end - elsif other.end == Float::INFINITY + elsif other.end == Float::INFINITY Nodes::LessThan.new(self, Nodes.build_quoted(other.begin, self)) else left = Nodes::LessThan.new(self, Nodes.build_quoted(other.begin, self)) if other.exclude_end? right = Nodes::GreaterThanOrEqual.new(self, Nodes.build_quoted(other.end, self)) - else + else right = Nodes::GreaterThan.new(self, Nodes.build_quoted(other.end, self)) end Nodes::Or.new left, right @@ -149,7 +149,7 @@ module Arel end def lt right - Nodes::LessThan.new self, right + Nodes::LessThan.new self, Nodes.build_quoted(right, self) end def lt_any others @@ -161,7 +161,7 @@ module Arel end def lteq right - Nodes::LessThanOrEqual.new self, right + Nodes::LessThanOrEqual.new self, Nodes.build_quoted(right, self) end def lteq_any others |