Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d7071c62c2
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (17 sloc) 0.716 kb
project-has-many-members
From: Bryan Larsen <bryan@larsen.st>
Let's do the other ends of those two belongs-to associations. In the Project model:
SHOW_PATCH
---
app/models/project.rb | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/app/models/project.rb b/app/models/project.rb
index f3a877a..53abe22 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -8,6 +8,8 @@ class Project < ActiveRecord::Base
end
has_many :stories, :dependent => :destroy
+ has_many :memberships, :class_name => "ProjectMembership", :dependent => :destroy
+ has_many :members, :through => :memberships, :source => :user
belongs_to :owner, :class_name => "User", :creator => true
Jump to Line
Something went wrong with that request. Please try again.