aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorBoris Slobodin <boris@slobodin.ca>2017-04-09 16:05:13 -0700
committerMatthew Draper <matthew@trebex.net>2017-04-10 08:35:13 +0930
commit24ac36be7150f97ac0a61cf7cbe7d212097ef1a6 (patch)
treee65092482c242de44b44cf2f5acc7f17c6070919 /activerecord/test/cases
parentee0f5c3f592be86fa80b0bde9aeb5a351a1f1df0 (diff)
downloadrails-24ac36be7150f97ac0a61cf7cbe7d212097ef1a6.tar.gz
rails-24ac36be7150f97ac0a61cf7cbe7d212097ef1a6.tar.bz2
rails-24ac36be7150f97ac0a61cf7cbe7d212097ef1a6.zip
exclude ORDER BY clause for exists? (#28699)
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/finder_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index 4fa664697c..a7b6333010 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -208,6 +208,11 @@ class FinderTest < ActiveRecord::TestCase
assert_equal true, Topic.order(:id).distinct.exists?
end
+ # Ensure +exists?+ runs without an error by excluding order value.
+ def test_exists_with_order
+ assert_equal true, Topic.order("invalid sql here").exists?
+ end
+
def test_exists_with_joins
assert_equal true, Topic.joins(:replies).where(replies_topics: { approved: true }).order("replies_topics.created_at DESC").exists?
end