aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation/or_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-01-18 22:58:54 +0900
committerGitHub <noreply@github.com>2019-01-18 22:58:54 +0900
commitff3d1a42d5800c999be7351b72317cefb5961ee8 (patch)
treeaebed0f35655dd073c8d7e271c56726ef171d3fb /activerecord/test/cases/relation/or_test.rb
parent92cc996a09b7ffd5908c3c6771484fdf82e8729a (diff)
parentc196ca72a0dfbea5f1730f830ea20a9e02a3c737 (diff)
downloadrails-ff3d1a42d5800c999be7351b72317cefb5961ee8.tar.gz
rails-ff3d1a42d5800c999be7351b72317cefb5961ee8.tar.bz2
rails-ff3d1a42d5800c999be7351b72317cefb5961ee8.zip
Merge pull request #30000 from kamipo/all_of_queries_should_return_correct_result
All of queries should return correct result even if including large number
Diffstat (limited to 'activerecord/test/cases/relation/or_test.rb')
-rw-r--r--activerecord/test/cases/relation/or_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/or_test.rb b/activerecord/test/cases/relation/or_test.rb
index 065819e0f1..8623867864 100644
--- a/activerecord/test/cases/relation/or_test.rb
+++ b/activerecord/test/cases/relation/or_test.rb
@@ -30,6 +30,11 @@ module ActiveRecord
assert_equal expected, Post.where("id = 1").or(Post.none).to_a
end
+ def test_or_with_large_number
+ expected = Post.where("id = 1 or id = 9223372036854775808").to_a
+ assert_equal expected, Post.where(id: 1).or(Post.where(id: 9223372036854775808)).to_a
+ end
+
def test_or_with_bind_params
assert_equal Post.find([1, 2]).sort_by(&:id), Post.where(id: 1).or(Post.where(id: 2)).sort_by(&:id)
end