Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
has_many through
class Project
has_many :project_departments
has_many :departments, through: :project_departments
end
class ProjectDepartment
belongs_to :project
belongs_to :project
end
class Department
has_many :project_departments
has_many :projects, through: :project_departments
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment