I have a situation where I have an array constant that I'd like to perform a string search on through a scope. I usually use AR to accomplish this but wasn't sure how to incorporate this with a static array. Obviously using a where clause wouldn't work here. What would be the best solution?
class Skills
SALES_SKILLS = %w(
Accounting
Mentoring
...
)
# Search above array based on "skill keyword"
scope :sales_skills, ->(skill) { }
end
scoperelevant to your question? Without it, I’d say you just want to search an array.