diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 21:24:09 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 21:25:19 +0530 |
commit | 00f3f6dc3145f2d7e8b8dadd966008cd0fa54636 (patch) | |
tree | 4b0fb5d2df9e8cbefdc17abfb90e0459fff7737c /activerecord/test | |
parent | 3db876cb761837ebf9b02d22846353e277ff14cd (diff) | |
download | rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.tar.gz rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.tar.bz2 rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.zip |
Relation#merge and Relation#except should respect locks
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 5 |
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 } |