1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Merge pull request #1001 from seanlinsley/patch-1

Fix callback to only run before update
This commit is contained in:
Jared Beck 2017-10-19 17:03:50 -04:00 committed by GitHub
commit 0bc9eb1f5f

View file

@ -59,7 +59,7 @@ module PaperTrail
# Adds a callback that records a version after an "update" event.
def on_update
@model_class.before_save(on: :update) { |r|
@model_class.before_save { |r|
r.paper_trail.reset_timestamp_attrs_for_update_if_needed
}
@model_class.after_update { |r|