Skip to content

Make new Model() identical to Model.build() - #6093

Merged
janmeier merged 1 commit into
sequelize:masterfrom
felixfbecker:new-model-like-model-build
Jun 12, 2016
Merged

janmeier merged 1 commit into
sequelize:masterfrom
felixfbecker:new-model-like-model-build

Conversation

@felixfbecker

Copy link
Copy Markdown
Contributor

This moves all logic from Model.build() to the constructor, so they accept the exact same parameters. The only difference is build() can also take an array of values. Also makes values optional.

Comment thread lib/model.js Outdated
options = _.extend({
isNewRecord: true,
$schema: this.$schema,
$schemaDelimiter: this.$schemaDelimiter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this needs to be changed here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Silly me, I just moved the code, commited and opened PR without thinking. You are right of course.

Makes Model.build() and new Model() identical except that build() can also take an array
Makes values parameter optional
@felixfbecker
felixfbecker force-pushed the new-model-like-model-build branch from 2d0566a to 53772df Compare June 12, 2016 13:42
@janmeier
janmeier merged commit 1810167 into sequelize:master Jun 12, 2016
@mickhansen mickhansen mentioned this pull request Aug 24, 2016
1 of 6 tasks
@felixfbecker
felixfbecker deleted the new-model-like-model-build branch August 27, 2016 13:49
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.

3 participants