Forum: Ruby on Rails has_many alias?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 cool_screen_name90001 (Guest)
on 2005-11-15 03:51
(Received via mailing list)
Is it possible to specify an alias with 'has_many'? I
have an items table and a comments table, and instead
of it being '@item.comments' I'd like it to be
'@item.member_comments'. Possible in Rails?


Yahoo! FareChase: Search multiple travel sites in one click.
Fc49ff6d82732b73a94be2974b4dd3df?d=identicon&s=25 gabriel.gironda (Guest)
on 2005-11-15 05:30
(Received via mailing list)
Yes, the documentation for AR associations is quite extensive:

has_many :member_comments, :class_name => 'Comment'
This topic is locked and can not be replied to.