Skip to content

Instantly share code, notes, and snippets.

@hrdwdmrbl
Created December 16, 2011 15:29
Show Gist options
  • Save hrdwdmrbl/1486463 to your computer and use it in GitHub Desktop.
Save hrdwdmrbl/1486463 to your computer and use it in GitHub Desktop.
Digging deeper into array#count
class CompanyProfile < ActiveRecord::Base
has_many :companies, :through => :companies_company_profiles
has_many :companies_company_profiles
end
class Company < ActiveRecord::Base
has_many :company_profiles, :through => :companies_company_profiles
has_many :companies_company_profiles
end
companies = @company_profile.companies
#The issue was being investigated because the association record was not being created when I used
#@company = @company_profile.companies.build(params[:company])
#@company.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment