user.rb
has_many :company_users, :dependent => :destroy
has_many :companies, through: :company_users
company_user.rb
belongs_to :company
belongs_to :user
company.rb
has_many :company_users, :dependent => :destroy
has_many :users, through: :company_users
How to write the FactoryGirl configuartion for company.
Whenever company is create company_user is also created with user_id and company_id field. How can I achieve this?
I'm not able to understand to get it.