如果Parent has_many :children,必须 Child :belongs_to :parent
Parent has_many :children
Child :belongs_to :parent
发布于 2009-05-28 16:09:22
不,belongs_to是不必要的。这将意味着您将无法从两个方向查询关联,但如果这不是您的应用程序的要求,那么就没有必要了。
belongs_to
https://stackoverflow.com/questions/921723
相似问题