rubysherpas / paranoia

acts_as_paranoid for Rails 5, 6 and 7
Other
2.87k stars 524 forks source link

skip updating paranoia_destroy_attributes for records while really_destroy! #535

Closed kortirso closed 1 year ago

kortirso commented 1 year ago

There is issue with destroying records when, for example:

and there is some additional profit, really_destroy! will work faster without updating timestamps

mathieujobin commented 1 year ago

if I understand your patch properly, its opt-out by default, so we need to specify really_destroy!(update_destroy_attributes: false) explicitly, otherwise, it makes no difference, am I reading this right?

Also, can you update the Changelog and bump the version, please?

kortirso commented 1 year ago

if I understand your patch properly, its opt-out by default, so we need to specify really_destroy!(update_destroy_attributes: false) explicitly, otherwise, it makes no difference, am I reading this right?

Also, can you update the Changelog and bump the version, please?

yes, by default everything will work as usually, and only who wants to skip updating in the middle of really_destroy - they will call really_destroy!(update_destroy_attributes: false)

kortirso commented 1 year ago

if I understand your patch properly, its opt-out by default, so we need to specify really_destroy!(update_destroy_attributes: false) explicitly, otherwise, it makes no difference, am I reading this right?

Also, can you update the Changelog and bump the version, please?

changelog and readme are updated

kortirso commented 1 year ago

@mathieujobin is it mergeable?

mathieujobin commented 1 year ago

Thanks for the ping, looks good

mathieujobin commented 1 year ago

released

kortirso commented 1 year ago

thank you