From 686e8fb52e00b24bd3a334cd7748df950914bfbf Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 10 Jun 2017 19:13:30 +0900 Subject: `Relation#locked?` should not build arel --- activerecord/test/cases/relations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases/relations_test.rb') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 86f3b0b962..5f36e4ec5d 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -2001,6 +2001,12 @@ class RelationTest < ActiveRecord::TestCase assert_equal binds, merged.bound_attributes end + def test_locked_should_not_build_arel + posts = Post.lock + assert posts.locked? + assert_nothing_raised { posts.lock!(false) } + end + def test_relation_join_method assert_equal "Thank you for the welcome,Thank you again for the welcome", Post.first.comments.join(",") end -- cgit v1.2.3 From 425f2cacafc522bb0aa426a0a4bc92c1237160aa Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 29 Jun 2017 02:11:28 +0900 Subject: Remove delegating to arel in a relation The delegation was needed since passing `relation` with `relation.bound_attributes`. It should use `relation.arel` in that case. --- activerecord/test/cases/relations_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/cases/relations_test.rb') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 5f36e4ec5d..84ccfbf5d5 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -2002,7 +2002,7 @@ class RelationTest < ActiveRecord::TestCase end def test_locked_should_not_build_arel - posts = Post.lock + posts = Post.locked assert posts.locked? assert_nothing_raised { posts.lock!(false) } end -- cgit v1.2.3