Skip to content

Commit

Permalink
users-have-many-projects
Browse files Browse the repository at this point in the history
We also need the other end of this association, in the User model:

SHOW_PATCH
  • Loading branch information
bryanlarsen committed Feb 19, 2010
1 parent 1293c7c commit 3ec54f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/user.rb
Expand Up @@ -13,6 +13,7 @@ class User < ActiveRecord::Base

has_many :task_assignments, :dependent => :destroy
has_many :tasks, :through => :task_assignments
has_many :projects, :class_name => "Project", :foreign_key => "owner_id"

# This gives admin rights to the first sign-up.
# Just remove it if you don't want that
Expand Down

0 comments on commit 3ec54f3

Please sign in to comment.