如果您有以下型号:
client has_many :projects
project has_many :tasks
tasks has_many :timeentries
和
timeentries belongs_to :task
task belongs_to :project
project belongs_to :client
那么您是否需要模型语句,例如:
timeentries belongs_to project :through => :tasks
client has_many :tasks, :through => :projects
谢谢