The Barge wrote: [...] > That is exactly how the database looks. Instead of people and hobbies, > my code actually uses Users and Characters. The People/Hobby was just > another example. Each user can have any number of characters, but only > one character is marked as the "selected character". > > The users table has a selected_character_id, and the characters table > has a user_id. > > Thanks.
OK...then how about class User has_many :characters belongs_to :selected_character, :class_name => 'Character' end class Character belongs_to :user end ? Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

