aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-28 16:43:28 -0400
committerGitHub <noreply@github.com>2017-06-28 16:43:28 -0400
commit8c65abe5f804522bcbf0d6f4327e7dfad0603941 (patch)
treed5ccbfd4eb67d82ff4ccd02c4d0b6f067d71fcd6 /activerecord/test/cases/relations_test.rb
parent97d276bf8a6b9d79dc50fcbc8a45f6071da0fcef (diff)
parent425f2cacafc522bb0aa426a0a4bc92c1237160aa (diff)
downloadrails-8c65abe5f804522bcbf0d6f4327e7dfad0603941.tar.gz
rails-8c65abe5f804522bcbf0d6f4327e7dfad0603941.tar.bz2
rails-8c65abe5f804522bcbf0d6f4327e7dfad0603941.zip
Merge pull request #29405 from kamipo/locked_should_not_build_arel
`Relation#locked?` should not build arel
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index dc81f13fe9..5767dec315 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -2007,6 +2007,12 @@ class RelationTest < ActiveRecord::TestCase
assert_equal binds, merged.bound_attributes
end
+ def test_locked_should_not_build_arel
+ posts = Post.locked
+ 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