【发布时间】:2011-12-01 05:36:13
【问题描述】:
我的情况是有几种不同的模型可以有 cmets。试图找出关系:
Post
has_many :comments
Update
has_many :comments
Comment
belongs_to EITHER :post OR :update (but not both)????
建立评论关系的正确方法是什么?我希望能够打电话给Post.comments 和Update.comments
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 activerecord polymorphic-associations