On Thursday, November 2, 2017 at 2:33:12 PM UTC+1, Satyanarayana Gandham 
wrote:
>
> Hi,
>
> In sequel gem, how can accomplish the following:
> * Store/Log every time a model is changed. Store/Log which properties are 
> changed, old value, new value and changed by whom?
>
> Is there a plugin which does it?
>

In general auditing should be done by a database trigger.  You can do it 
with a before_update/before_delete hook in Sequel, but it is not as nice.

Instead of storing changes, just store a versioned copy of the row in a 
separate table.  You can do comparison between rows of the auditing table 
to get old/new values.  For "changed by whom", have the main table store a 
"last_modified_by", and then you know who was responsible for each 
modification.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to