aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index bcecf74737..f895f8b8d2 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -407,6 +407,11 @@ class RelationTest < ActiveRecord::TestCase
end
end
+ def test_relation_merging_with_locks
+ devs = Developer.lock.where("salary >= 80000").order("id DESC") & Developer.limit(2)
+ assert devs.locked.present?
+ end
+
def test_relation_merging_with_preload
[Post.scoped & Post.preload(:author), Post.preload(:author) & Post.scoped].each do |posts|
assert_queries(2) { assert posts.first.author }