How to create a full Audit log in Rails for every table?

后端 未结 4 1296
星月不相逢
星月不相逢 2020-12-13 00:57

We recently began a compliance push at our company and are required to keep a full history of changes to our data which is currently managed in a Rails application. We\'ve

4条回答
  •  天命终不由人
    2020-12-13 01:22

    I had a similar requirement on a recent project. I ended using the acts_as_audited gem, and it worked great for us.

    In my application controller I have line like the following

    audit RunWay,RunWayModel,OtherModelName
    

    and it takes care of all the magic, it also keeps a log of all the changes that were made and who made them-- its pretty slick.

    Hope it helps

提交回复
热议问题