Taylor Strait wrote: > Frederick Cheung wrote: >> On 2 Jan 2009, at 17:36, Taylor Strait wrote: >>> Most of this works. User.referrals returns all the referral objects. >>> Referral.referer and Referral.referee both return the appropriate >>> objects. But the User.referer/referee methods both raise the same >>> error: >>> >> >> The class_name option should really be a string (ie :class_name => >> 'User') >>
Actually I spoke too soon. User.referer always returns nil, even if there is a referral record with appropriate referee_id and referer_id. Also, if I do user1.referer = user2 a NoMethodError is raised: NoMethodError: undefined method `update_attributes' for #<Class:0x237de24> User.referees does correctly return an array of user objects, though. -- 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 -~----------~----~----~----~------~----~------~--~---

