我遵循極其簡單的set up guide for the paper_trail gem。未定義方法'paper_trail_event ='
在我的課堂我有
class MyClass
has_paper_trail on:[:update]
一切工作正常,直到我決定把我自己的蹤跡事件按照paper_trail指南:
PaperTrail supplies a custom accessor method called paper_trail_event, which it will attempt to use to fill the event field before falling back on one of the default events.
所以現在,在一個我設置的事件是這樣的:
def change_status
self.paper_trail_event = 'status_change_event'
self.status = 'pending'
self.save
end
但是當我這樣做時,我得到這個錯誤:
undefined method `paper_trail_event='
我在做什麼錯?