So I just found out that I sort my models via folders and am starting a
new project to mess around with this some. So I started working on
can-can, but am at a lost on how to do “has_many :user_roles”
On 2 January 2011 21:21, Mohammad El-abid [email protected] wrote:
So I just found out that I sort my models via folders and am starting a
new project to mess around with this some. So I started working on
can-can, but am at a lost on how to do “has_many :user_roles”
Have you read the Rails Guide on ActiveRecord Associations?
Colin
Yes I have. :class does not work either
has_many :user_roles, :class => “User::Roles”
gives:
NameError: uninitialized constant User::User::Role
Oh duh, It’s :class_name => “Users::Role” and in the post above this,
it’s a typo I have User::Role, but the namespace is plural