I have a model as follows:
Campaign
has_many :companies, :through => :contacts
There are many contacts with the same company. I just want one instance of each company.
I tried the following:
@campaign = Campaign.find(params[:id])
@companies = @campaign.companies
But this shows me all the companies for every contact I believe. At least that's what the output looks like.
How can I make sure that only a single instance of a company is added?