Is there a specific reason I need the self
in this model's method? I'm accessing it from another controller.
def self.search(query)
if query
find(:all, conditions: ['lower(first_name) LIKE ? OR lower(last_name) LIKE ?', "%#{query.downcase}%", "%#{query.downcase}%"])
else
find(:all)
end
end