aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
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/models
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/models')
-rw-r--r--activerecord/test/models/post.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index 4c913b3b72..ed64e0ee52 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -22,6 +22,7 @@ class Post < ActiveRecord::Base
scope :ranked_by_comments, -> { order("comments_count DESC") }
scope :limit_by, lambda { |l| limit(l) }
+ scope :locked, -> { lock }
belongs_to :author
belongs_to :readonly_author, -> { readonly }, class_name: "Author", foreign_key: :author_id