Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model events not fired when using Model.update(conn,id,data,callback) #61

Open
lbrucher opened this issue Apr 4, 2013 · 0 comments
Open

Comments

@lbrucher
Copy link

lbrucher commented Apr 4, 2013

The events do however get fired when calling update() on a model instance.
I understand that in the Model.update() case we don't have an instance to pass to the event methods but maybe we could pass the 'data' argument? And maybe add an extra param to the event method to indicate the given obj is a partial or a full instance?

Currently this make the use of Model.update() limited and not practical when registering those events.
In my case, I have defined a beforeSave event to update a 'updated_at' datetime field on model instances. The fact that Model.update() does not fire the event makes this method essentially useless to me. Or should this be handled/implemented in a different way?

Happy to send a pull request if you guys think this could make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant