I have a model Publication and a model Category in my Rails app. Both are connected with a has_and_belongs_to_many association.
Now I would like to search publications that match one or more categories. If more than one category is given they have all assigned to the publication. I want to specify the categories in a multiple select_box.
Publication.released.categories_id_is([1,2])
is not working because the categories are connected with OR.
With Publication.categories_id_is_all([1,2])
the categories are connected with AND, but no result is given back.
Any idea's on that? Am I mising the right point in the docs. Thanks for your very welcome help!