Use Enumerable#any?
def has_dog?(acct)
[acct.title, acct.description, acct.tag].any? { |text| text.include? "dog" }
end
It will return true/false.
Use Enumerable#any?
def has_dog?(acct)
[acct.title, acct.description, acct.tag].any? { |text| text.include? "dog" }
end
It will return true/false.