Can I use an ActiveRecord scope as an instance method?
Scopes
are nothing but class methods
.You can define it like this
def self.in_good_standing?
#your logic goes here
end
Adding my original comment as an answer:
As @meagar stated, you can't, because they are doing very different things. The most you could do is have your instance method call the scope and check to see if it's part of the returned results. However that won't work if the instance has not been saved yet. So in your method you could do:
User.in_good_standing.where(:id => self.id).present?