I have a house model and business_model column. This column can be set as, "awake", "sleep" or "awake, sleep" with radio buttons, all string. I would like to get all the houses include business_model as "awake" for instance.
@house = (House.all).uniq.where("business_model like ?", "sleep")
You need to throw some wild cards in there. Try
where("business_model like ?", "%sleep%"). Note that this will also catch things like
You may want to consider using a JSON database column that gives you more control over the querying.