I have a database with a field called ‘category’.
‘category’ contains the categories separated by a “,” i.e. 1, 2, 5
I know with something like:
@products = Product.find(:all, :condition => “category = ‘1’”)
I could get some results if any of the ‘category’ fields only contained
“1” but most contain multiple values.
Does anybody know if there is anything in rails that can deal with this?
Also I was looking at mysql regexp statements, but I’m not smart enough
to write any sort of valuable regular expression.
Any help would be greatly appreciated. Thanks.