inheritance - sequelizejs, update attributes in inherit model -


i have model like:

---------------------- id | parent_id | sum 1  | nil       | 100 2  | 1         | 30 3  | 1         | 70 --------------------- 

if instance 3 changed sum 60, instance 1 's sum change 90 too.

currently, use afterupdate hook change parent's sum, may cause lot of sql find parent's instance.

any other suggestion??


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -