aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-01-11 11:20:05 -0800
committerGitHub <noreply@github.com>2019-01-11 11:20:05 -0800
commit3a1b2a21965c0cd7bcccff586ce04b029eb4c359 (patch)
treecae3de24484064bf3b155db4413a23c2ac8074ce /activerecord/lib/arel
parentc11cf116f320990a537c0921bb9325f7fa22e34f (diff)
parent7110dbea008dd4b80d1764003935a3c97ab10f57 (diff)
downloadrails-3a1b2a21965c0cd7bcccff586ce04b029eb4c359.tar.gz
rails-3a1b2a21965c0cd7bcccff586ce04b029eb4c359.tar.bz2
rails-3a1b2a21965c0cd7bcccff586ce04b029eb4c359.zip
Merge pull request #34906 from gregnavis/add-endless-ranges-to-activerecord
Support endless ranges in where
Diffstat (limited to 'activerecord/lib/arel')
-rw-r--r--activerecord/lib/arel/predications.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/arel/predications.rb b/activerecord/lib/arel/predications.rb
index 28679ae892..0c03e93138 100644
--- a/activerecord/lib/arel/predications.rb
+++ b/activerecord/lib/arel/predications.rb
@@ -36,14 +36,14 @@ module Arel # :nodoc: all
def between(other)
if infinity?(other.begin)
- if infinity?(other.end)
+ if other.end.nil? || infinity?(other.end)
not_in([])
elsif other.exclude_end?
lt(other.end)
else
lteq(other.end)
end
- elsif infinity?(other.end)
+ elsif other.end.nil? || infinity?(other.end)
gteq(other.begin)
elsif other.exclude_end?
gteq(other.begin).and(lt(other.end))