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
classItemVariant < ActiveRecord::Basehas_paper_trail:on=>[:update,:destroy],:class_name=>'ItemVariantVersion',if: proc{|t| t.changed? && (t.updated_at < Time.current - 1.week)}end# then wheniv=ItemVariant.newiv.save!# no versioniv.updated_at=2.weeks.ago;iv.save!iv.first_name='this should trigger versioning'iv.save!# => should create version
Starting with version 4.0.0, new version is never created because attribute 'updated_at' in the if proc is already updated to now. Works fine under 3.0.8.
I'm not familiar enough with the codebase but it might be related to this pull request: #563
The text was updated successfully, but these errors were encountered:
#375 / #374 / #354 / #131 - Versions are now saved with an after_ callback, instead of a before_ callback. This ensures that the timestamp field for a version matches the corresponding timestamp in the model.
Thanks for opening the issue, I can see why you'd think it was a regression, but it was deliberate.
oic, thanks @jaredbeck! It makes sense now. I find it a bit counter-intuitive though, maybe it would be good to mention it in the doc, especially under 'Choosing When To Save New Versions'.
Given:
Starting with version 4.0.0, new version is never created because attribute 'updated_at' in the if proc is already updated to now. Works fine under 3.0.8.
I'm not familiar enough with the codebase but it might be related to this pull request: #563
The text was updated successfully, but these errors were encountered: