I have a user table and a request table. The user table contains employees and clients. I have added user_id and employee_id to the request table.
I thought the following would allow me to have both foreign keys point to the user table:
belongs_to :user # foreign_key "user_id"
belongs_to :employee, :class_name => "user", :foreign_key => "employee_id" # foreign_key "employee_id"
But, I get “uninitialized constant request::user” from this form line:
<%= f.association :employee, :label_method => :full_name, :label => 'Assigned To' %>
What am I doing wrong?
Thanks !!
Have you tried using
:class_name => "User"instead of:class_name => "user"?