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

destroyWith in ns.Model #149

Merged
merged 3 commits into from
Aug 26, 2013
Merged

destroyWith in ns.Model #149

merged 3 commits into from
Aug 26, 2013

Conversation

yanann11
Copy link
Contributor

No description provided.

@edoroshenko
Copy link
Contributor

Договорились голосом, что делаем по-другому. У модели будет метод destroyWith, который на входе получает модель и подписывается на её destroy

*/
ns.Model.prototype.destroyWith = function(models) {
if (!models) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это сокрытие ошибки. Либо не проверяй, либо кидай exception

ns.Model.destroy(this);
}.bind(this));
} else {
throw new Error("[ns.Model] destroyWith'param in " + this.id + " is not ns.Model");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

предлагаю так: "[ns.Model] " + this.id + " destroyWith expected ns.Model or Array of ns.Model in argument"

yanann11 added a commit that referenced this pull request Aug 26, 2013
@yanann11 yanann11 merged commit 1ab054f into master Aug 26, 2013
@yanann11 yanann11 deleted the destroy-with branch August 26, 2013 15:42
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

Successfully merging this pull request may close these issues.

4 participants