使用include中嵌Hash取出一个多层次的对象关联数据.
首先有如下关系:
project issue : 一对多
issue comment : 一对多
comment history : 一对多
Project [1] <---- [n] issue (1) <---- (n) comment [1] <---- [n] history
class Project
has_many :issues
end
class Issue
belongs_to :project
has_many :cccc # c ...







评论排行榜