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 committed Nov 14, 2011
1 parent fe66214 commit d20f048
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/project.rb
Expand Up @@ -11,6 +11,9 @@ class Project < ActiveRecord::Base

children :stories

has_many :memberships, :class_name => "ProjectMembership", :dependent => :destroy
has_many :members, :through => :memberships, :source => :user

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

# --- Permissions --- #
Expand Down

0 comments on commit d20f048

Please sign in to comment.