I have a model
class User < ActiveRecord::Base
has_many :articles
def good_publisher?
self.articles.size > 50
end
scope :good_publishers, -> where { ...???? }
end
How do I express the scope through good_publisher?? Something like
scope :good_publishers, -> where { x.good_publisher? }
user.good_publisher?in-> where { .... }good_publisher?is an instance method, while a scope creates class method, so no... there's no way you can use instance method in a scope. What are you trying to do?User. good_publishersanduser.good_publisher??