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

Added HasMany#injectCreator and Model.createAssociatedModel() #1213

Merged
merged 7 commits into from Jan 8, 2014

Conversation

2 participants
@saschagehlich
Contributor

saschagehlich commented Jan 7, 2014

No description provided.

@saschagehlich

This comment has been minimized.

Contributor

saschagehlich commented Jan 7, 2014

Also, renamed the HasManyMultiLinked variable to HasManyDoubleLinked

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Jan 8, 2014

Good work, eventually we'll probably want to add createAssociatedModels and perhaps add it to belongsTo/hasOne aswell. But might aswell merge this now.

.create(values, fieldsOrOptions)
.proxy(emitter, { events: ['error', 'sql'] })
.success(function(newAssociatedObject) {
instance[self.accessors.add](newAssociatedObject)

This comment has been minimized.

@mickhansen

mickhansen Jan 8, 2014

Contributor

You need to pass on the transaction option here - Or transactions wont work with createAssociatonModel

This comment has been minimized.

@saschagehlich

saschagehlich Jan 8, 2014

Contributor

.addAssociation does not support transactions, so .createAssociation can't support them either (opened a ticket #1215, maybe I'll fix this today)

@mickhansen

This comment has been minimized.

Contributor

mickhansen commented Jan 8, 2014

Beautiful work.

mickhansen added a commit that referenced this pull request Jan 8, 2014

Merge pull request #1213 from saschagehlich/feature/create-relation-o…
…bjects

Added HasMany#injectCreator and Model.createAssociatedModel()

@mickhansen mickhansen merged commit c5ec427 into sequelize:master Jan 8, 2014

1 check passed

default The Travis CI build passed
Details

@saschagehlich saschagehlich deleted the saschagehlich:feature/create-relation-objects branch Jan 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment