alias in belongs_to (hobofields)
Reported by arct33 | November 29th, 2008 @ 04:43 PM
class Project < ActiveRecord::Base
belongs_to :user
belongs_to :owner, :class_name => 'User'
end
HoboMigration creates two fields user_id, and owner_id. But owner is alias for user_id
Comments and changes to this ticket
-
Tom Locke December 1st, 2008 @ 02:56 PM
- State changed from new to investigating
Hi. I don't understand what "But owner is alias for user_id" means. Can you clarify?
-
kevinpfromnm December 6th, 2008 @ 06:23 AM
Then remove the second belongs_to declaration and alias the first's method. Though why do you need a second method to access one variable?
-
Tom Locke March 13th, 2009 @ 02:38 PM
- State changed from investigating to invalid
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป