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

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

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -