I have three models with has many through association User model class User < ActiveRecord::Base has_many :user_projects has_many :projects, through: :user_projects end
Project model
class Project < ActiveRecord::Base has_many :user_projects has_many :users, through: :user_projects end
UserProject model class UserProject < ActiveRecord::Base belongs_to :user belongs_to :project end
How to create factories for these three models
Aucun commentaire:
Enregistrer un commentaire