【发布时间】:2011-10-21 18:24:06
【问题描述】:
Project
has_many :tasks
Task
has_many :invoices, :through => :line_items
has_many :line_items
LineItems
belongs_to :invoice
belongs_to :task
Invoice
has_many :tasks, :through=> :line_item
has_many :line_items
我正在尝试从 Project has_many :invoices, :through => :tasks 中获取关联
当我尝试这样做时,我得到:
无效的源反射宏 :has_many :through for has_many :invoices, :through => :tasks。使用 :source 指定源反射。
我有点不知所措,如果这是可能的,如果可以,如何正确使用 :source
【问题讨论】:
标签: ruby-on-rails-3 activerecord