aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/topic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/topic.rb')
-rw-r--r--activerecord/test/models/topic.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 8cd4dc352a..a924cf86ae 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -12,9 +12,16 @@ class Topic < ActiveRecord::Base
scope :scope_with_lambda, lambda { all }
- scope :by_lifo, -> { where(author_name: "lifo") }
+ scope :by_lifo, -> { where(author_name: author_name) }
scope :replied, -> { where "replies_count > 0" }
+ class << self
+ private
+ def author_name
+ "lifo"
+ end
+ end
+
scope "approved_as_string", -> { where(approved: true) }
scope :anonymous_extension, -> {} do
def one