ruby on rails - Marking Related Models Deleted -


i have following models

note has_many replies

when delete notes want automatically update replies following columns

deleted_at: time.now status: 2 

is there anyway automatically callbacks?

if want mark notes deleted_at well, paranoia gem solves problem https://github.com/radar/paranoia, can recursively restore associated objects.

if wanted change status - have use callbacks - whther own or through state machine transitions (aasm).


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -