Hello,
I am defining the following scope for my model:
class Entry < ActiveRecord::Base
attr_accessible :email, :published, :result_id, :text, :url
belongs_to :result
def self.not_filtered(keywords)
where(['text NOT IN (?)', keywords]) if keywords.any?
end
This is supposed to return only Entries where the Entry.text doesn’t contain any of the keywords.
Example:
entries.not_filtered([“realtor”, “quadplex”, “duplex”, “condo”, “agent”, “broker”])
But somehow this doesn’t exclude the entires which include the keywords in the array.
Is there a way to write that differently? How?