paper-trail-gem / paper_trail

Track changes to your rails models
MIT License
6.79k stars 896 forks source link

Only set the attribute value in reify when it's different #1473

Open tubaxenor opened 5 months ago

tubaxenor commented 5 months ago

This is related to https://github.com/paper-trail-gem/paper_trail/pull/1468/files#r1601766553

We shouldn't set something again if the value is no difference from the original value. In some cases such like read only attributes might already set with a default value and will not change over time, this is helpful and will not violate Rails 7.1's new default config raise_on_assign_to_attr_readonly.

jaredbeck commented 5 months ago

Looks good, please add an entry to the Changlog under "Fixed"

jaredbeck commented 5 months ago

@ngan @professor @technicalpickles Thoughts?

ngan commented 5 months ago

Yeah, I think this is a reasonable approach. @tubaxenor can make the request changeling updates when he's back online.

fynsta commented 2 months ago

We also ran into this problem when upgrading the Rails version. What's the status on this PR?