You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you skip the create audit you might get inaccurate data with revisions. For example, if you have a User model w/ first_name, middle_name, last_name attributes, include audited w/o create via audited on: %I[update destroy] and you create a new user via:
notice the middle_name for this singular revision is still nil. Things get interesting if you now update that middle_name attribute and run revisions again:
u.update!(middle_name: "F")u.revisions
notice that the middle_name for both revisions now incorrectly shows "F" as the value. This shouldn't be the case for the 1st revision as it was still nil as shown above.
If you skip the create audit you might get inaccurate data with revisions. For example, if you have a
User
model w/first_name, middle_name, last_name
attributes, include audited w/ocreate
viaaudited on: %I[update destroy]
and you create a new user via:calling
which is expected.
However, if you make a couple updates, you'll start to see the revision data fall apart, e.g.
returns expected results:
notice the
middle_name
for this singular revision is stillnil
. Things get interesting if you now update thatmiddle_name
attribute and run revisions again:notice that the
middle_name
for both revisions now incorrectly shows"F"
as the value. This shouldn't be the case for the 1st revision as it was stillnil
as shown above.The text was updated successfully, but these errors were encountered: