I have a model Shop
:
class Shop < ActiveRecord::Base
has_and_belongs_to_many :services
end
and a model Service
:
class Service < ActiveRecord::Base
has_and_belongs_to_many :shops
end
I would like to query every shop that provides all of the following services:
- Reparation
- Advise
- Shipping
So return all shops where services contain reparation AND advise AND shipping
.
Is this possible with ActiveRecord querying only?
Thanks!