collectiveidea / awesome_nested_set

An awesome replacement for acts_as_nested_set and better_nested_set.
MIT License
2.39k stars 492 forks source link

Don't reload in after_save callback #413

Closed p8 closed 4 years ago

p8 commented 5 years ago

AwesomeNestedSet calls reload in the after_save callback if depth is set. This can break dependencies that clear state during reload. For example carrierwave uses reload to clear the mounters which will result in attached files not being saved (see #375).

Reload also doesn't seem necessary because there is no state that should be updated for getting the depth (as far as I can see). Specs also don't break.

luk4s commented 4 years ago

👍

parndt commented 4 years ago

Thanks @p8

yourtallness commented 4 years ago

@p8 Hello, it appears this fix has not been released as a tagged version. Version 3.2.0 dates back to August 2019.

Will you be pushing it to rubygems? Thank you

p8 commented 4 years ago

Hi @yourtallness, I can't push this gem. Maybe @parndt could do that.

parndt commented 4 years ago

Yes, I suppose it's about time we released even 3.2.1 with this 😄

parndt commented 4 years ago

https://rubygems.org/gems/awesome_nested_set/versions/3.2.1