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

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

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -