#我發表過forum的comments
has_many :forum_comments, :through => :forums, :source => :comments
#forum 裡有我的 comments的 forum, 找出 forum array
has_many :forums_has_comments,
:through => :comments,
:source => :record,
:source_type => 'Forum'
#我在forum 裡所有的comments, 找出 comments array
has_many :comments_in_forums,
:foreign_key => :user_id,
:class_name => 'Comment',
:conditions => {:record_type => 'Forum'}
沒有留言:
張貼留言