Hello All, I have a model "Company" class Company < ActiveRecord::Base has_and_belongs_to_many :types end And I also have MachineType and CompanyType that STI from the "Type" model. I have both a MachineType id and a CompanyType id and I want to get all companies that have both of those types. Is there a way similar to something like this: @companies MachineType.find(params[:type]).companies.types.find(@type) ? I''m just trying to figure out how to do this type of thing without some nasty joins. Thanks! BJ Clark the science department. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---