4
更換條件我有這樣的聯想:上的has_many:通過協會,與拉姆達
has_many :foo_participators, through: :foos, source: :user, conditions: "foos.state = 'completed'"
Rails的告訴我:
棄用警告:在你的Bar.has_many 以下選項:foo_participators聲明已棄用::條件。請改用示波器 。例如,以下內容:
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'
應該被改寫爲以下幾點:
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'
這可能與我的聯想?