Permalink
Browse files

users-have-many-projects

We also need the other end of this association, in the User model:

SHOW_PATCH
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 81f65a0 commit d7470ae3aa16d40e961c52b038f23e0188ebb67e
Showing with 1 addition and 0 deletions.
  1. +1 −0 app/models/user.rb
View
@@ -14,6 +14,7 @@ class User < ActiveRecord::Base
has_many :task_assignments, :dependent => :destroy, :inverse_of => :user
has_many :tasks, :through => :task_assignments
has_many :projects, :class_name => "Project", :foreign_key => "owner_id", :inverse_of => :owner
# This gives admin rights and an :active state to the first sign-up.
# Just remove it if you don't want that

0 comments on commit d7470ae

Please sign in to comment.