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
Post a Comment