paper_trailはうまく機能しています。しかし、Heroku のコンソールにログインしてからheroku run console
変更を加えると、変更元が設定されていません :(。したがって、paper_trail にはこのためのメカニズムがあります。
In a console session you can manually set who is responsible like this:
>> PaperTrail.whodunnit = 'Andy Stewart'
>> widget.update_attributes :name => 'Wibble'
>> widget.versions.last.whodunnit # Andy Stewart
You can avoid having to do this manually by setting your initializer to pick up the username of the current user from the OS, like this:
<bunch of code>
私の質問は、Heroku でこれをどのように自動化できるでしょうか? このようなことはありますか?
heroku run console -e "PaperTrail.whodunnit = '123:console'"
次に、それぞれがconsole.sh
個々のユーザー ID を使用して、上記のファイルを簡単に作成できます。または、これを自動化する別のメカニズムはありますか?