Answer the question
In order to leave comments, you need to log in
How to insert a condition for scope, during where?
For example, there is this code
scope :age, -> { age >= 99 }
Person.where(name: 'Alex').age
Person.where(name: 'Alex').filter
def filter
if expression
age #scope
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question