I have the following in my controller:
@campaign = Campaign.where(:id => params[:id])
@companies = @campaign.companies.sort { |a,b| a.name <=> b.name` }
The second line gives me an unknown method for companies
and it worked fine before.
This is in my campaign model:
has_many :companies, :through => :contacts, :uniq => true
I tried the following and it still didn't fix it:
has_many :companies, :through => :contacts, :uniq => true, :source => :company