views:

29

answers:

0

Hi folks, big problem

u = User.username_like('hans').first
# works
u.projects
# error undefined "local variable or method" for project

What's wrong with that?

Model Code

class User
  has_many :projects
end

Class Project
  belongs_to :owner, :class_name => "User", :foreign_key => "user_id"
end

please help, thanks in advance :)