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
I've been experimenting today and found that if you have a HABTM association which is set through disposable such as tag_ids then the underlying active record will save itself when the setter for that attribute is invoked.
This means that calling sync() on disposable can inadvertently save the underlying record. This would presumably also happen with has_many associations of a similar nature that AR also likes to autosave.
This is a quirk with AR rather than anything specific to Disposable, but after a Gitter conversation with @apotonick he asked me to file this as a reminder to anyone.
The text was updated successfully, but these errors were encountered:
I've been experimenting today and found that if you have a HABTM association which is set through disposable such as
tag_ids
then the underlying active record will save itself when the setter for that attribute is invoked.This means that calling
sync()
on disposable can inadvertently save the underlying record. This would presumably also happen with has_many associations of a similar nature that AR also likes to autosave.This is a quirk with AR rather than anything specific to Disposable, but after a Gitter conversation with @apotonick he asked me to file this as a reminder to anyone.
The text was updated successfully, but these errors were encountered: