I have a "Stores" model that contains various locations. Among the attributes for each store is the the "brands" that is carries.
Example: Store1, brands: "Nike, Adidas, Polo"; Store2, brands: "Jcrew, Polo"
I want to be able to select all stores where brand contains "Adidas" (may also contain other brands)
Something along the lines of:
@search = Stores.where(brands: params[:brand])
but need it to be
@search = Stores.where(brands.include? params[:brand])
which clearly doesn't work
What's the best way to deal with this?