sghribi / loopback-fixtures

ISC License
18 stars 21 forks source link

Is Possible to pass options? #14

Open jaime-franco-dat opened 7 years ago

jaime-franco-dat commented 7 years ago

Just wondering if is possible to pass options to be pass to the observers for avoiding some actions?

sghribi commented 7 years ago

Hi @jaime-franco-dat I'm not sure I understand your question: could you give me an example of what you would like to do?

jaime-franco commented 7 years ago

For example, if I had this observe :

MyModel.observe('before save', function (ctx, next) {
  if (ctx.options && ctx.options.skipAction) return next();
  ... 
});

Is there a way to pass options for avoiding trigger some behaviors in the hooks when objects are created?