i have the following models:
class HealthCareInsurance < ActiveRecord::Base
has_and_belongs_to_many :companies
end
class Company < ActiveRecord::Base
has_and_belongs_to_many :health_care_insurances
end
Now, inside my controller, i need to get only those filling the condition: "id NOT IN ( my_array )". Seems easy but i just cant make it work.
Im doing the following:
@company.health_care_insurances( :conditions => [ "id NOT IN ( ? )", insurances_array])
But for some reason it gives me the exact same elements as if i change the "NOT IN" condition for an "IN" condition. Tried "where" too, but it always returns an empty array. Any ideas?
Thanks in advance