pre middleware #7

Closed
tblobaum opened this Issue Mar 22, 2013 · 6 comments

Projects

None yet

5 participants

@tblobaum
new ExtendedModel().save()
// pre save middleware placed on ExtendedModel.schema executes

ExtendedModel.findOne(function (e, doc) {

  console.log(doc instanceof ExtendedModel)
  // => true

  doc.save()
  // pre save middleware placed on ExtendedModel.schema does NOT execute
  // only the inherited schema's middleware works

})
@saatchiCEO

Uh-oh, that's very bad. Bump.

@windwhinny

hava the same issue

@sieira
Collaborator

Working on it:
#35

@sieira sieira added the bug label Nov 11, 2015
@sieira sieira self-assigned this Nov 11, 2015
@sieira
Collaborator

Well, this solves it

#36

Unfortunately, it forces the user to include the --harmony-proxies flag.

#35 solves it as well, but not so well, and anyway O.o will soon be deprecated, I will merge the proxies approach in a couple of days if no-one has a better solution.

https://esdiscuss.org/topic/status-of-chrome-proxy-in-face-of-object-observe-removal

This was referenced Nov 11, 2015
@sieira
Collaborator

This is solved in 2.0.1

@sieira sieira closed this Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment