做了题为范围:命名范围工作,但协会不
class Activity
scope :active, where("active = ?", true)
has_many :attachments, :as => :attachable
accepts_nested_attributes_for :attachments
end
a = Activity.active
做工精细但联想a.attachments
没有(NoMethodError:未定义的方法`附件)
呼吁附件时你为什么会想到内属于一个活动访问附件范围(即在活动的集合) – 2012-07-26 06:24:11