aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-01-12 07:44:27 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-01-12 07:44:27 +0900
commitbb75d68fe2262199a16973c09a8b2749542c7590 (patch)
tree50bcf54877369210b2f13c4a26991538c5cd032b /activerecord/lib/arel
parent3a1b2a21965c0cd7bcccff586ce04b029eb4c359 (diff)
downloadrails-bb75d68fe2262199a16973c09a8b2749542c7590.tar.gz
rails-bb75d68fe2262199a16973c09a8b2749542c7590.tar.bz2
rails-bb75d68fe2262199a16973c09a8b2749542c7590.zip
More exercise test cases for `not_between`
And support endless ranges for `not_between` like as `between`. Follow up #34906.
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 0c03e93138..2a62c53aa3 100644
--- a/activerecord/lib/arel/predications.rb
+++ b/activerecord/lib/arel/predications.rb
@@ -82,14 +82,14 @@ Passing a range to `#in` is deprecated. Call `#between`, instead.
def not_between(other)
if infinity?(other.begin)
- if infinity?(other.end)
+ if other.end.nil? || infinity?(other.end)
self.in([])
elsif other.exclude_end?
gteq(other.end)
else
gt(other.end)
end
- elsif infinity?(other.end)
+ elsif other.end.nil? || infinity?(other.end)
lt(other.begin)
else
left = lt(other.begin)