diff options
author | Aaron Patterson <tenderlove@github.com> | 2019-01-11 11:20:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 11:20:05 -0800 |
commit | 3a1b2a21965c0cd7bcccff586ce04b029eb4c359 (patch) | |
tree | cae3de24484064bf3b155db4413a23c2ac8074ce /activerecord/test | |
parent | c11cf116f320990a537c0921bb9325f7fa22e34f (diff) | |
parent | 7110dbea008dd4b80d1764003935a3c97ab10f57 (diff) | |
download | rails-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/test')
-rw-r--r-- | activerecord/test/cases/arel/attributes/attribute_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/arel/attributes/attribute_test.rb b/activerecord/test/cases/arel/attributes/attribute_test.rb index 671e273543..6ad54ab5df 100644 --- a/activerecord/test/cases/arel/attributes/attribute_test.rb +++ b/activerecord/test/cases/arel/attributes/attribute_test.rb @@ -639,6 +639,18 @@ module Arel ) end + if Gem::Version.new("2.6.0") <= Gem::Version.new(RUBY_VERSION) + it "can be constructed with a range implicitly ending at Infinity" do + attribute = Attribute.new nil, nil + node = attribute.between(eval("0..")) # Use eval for compatibility with Ruby < 2.6 parser + + node.must_equal Nodes::GreaterThanOrEqual.new( + attribute, + Nodes::Casted.new(0, attribute) + ) + end + end + it "can be constructed with a quoted range ending at Infinity" do attribute = Attribute.new nil, nil node = attribute.between(quoted_range(0, ::Float::INFINITY, false)) |