bredikhin / barrels

Simple DB Fixtures for Sails.js
MIT License
85 stars 34 forks source link

Populate+improve options #38

Closed Kyr closed 8 years ago

Kyr commented 8 years ago

Explanation:

Given we have model::sails.model that, for some reason, have lifecycle callback:

beforeDestroy: function(condition, next){
  next(new Error(403, 'Delete forbidden'));
}

When trying to populate fixtures into Model throws exception.

Solution:

Give ability to preserve exists data via passing parameter to .populate. Aside: wrap passed options to object, with backward capability.

I'm so sorry about 'spaces'.

ybrodsky commented 8 years ago

I am having the problem described by @Kyr . This is needed.

bredikhin commented 8 years ago

I really can't estimate / review the changes without the original two-space coding style kept. Please convert your code to the original repository style and rebase your commits with the current master. Thanks!

Kyr commented 8 years ago

My apologies @bredikhin , I'm restore original code-style. Maybe adding .editorconfig could avoid such confusing?

bredikhin commented 8 years ago

Sorry, I still see some tabs in the code. Also, the PR can't be merged because of some conflicts, and the code itself needs more work. Please, resolve the conflicts and open a new PR against the branch called feature/options.