Skip to content

Commit

Permalink
project-has-many-members
Browse files Browse the repository at this point in the history
Let's do the other ends of those two belongs-to associations. In the Project model:

SHOW_PATCH
  • Loading branch information
bryanlarsen authored and iox committed Aug 12, 2013
1 parent 73ec433 commit 2286479
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/project.rb
Expand Up @@ -13,6 +13,10 @@ class Project < ActiveRecord::Base

children :stories

belongs_to :owner, :class_name => "User", :creator => true, :inverse_of => :projects
has_many :memberships, :class_name => "ProjectMembership", :dependent => :destroy, :inverse_of => :project
has_many :members, :through => :memberships, :source => :user

belongs_to :owner, :class_name => "User", :creator => true, :inverse_of => :projects

# --- Permissions --- #
Expand Down

0 comments on commit 2286479

Please sign in to comment.