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

Not saving multiple associations #4

Closed
brenolf opened this issue Oct 16, 2015 · 2 comments
Closed

Not saving multiple associations #4

brenolf opened this issue Oct 16, 2015 · 2 comments
Assignees

Comments

@brenolf
Copy link

brenolf commented Oct 16, 2015

When trying to add multiple belongsTo relationships, only the last one is actually saved.

For instance:

let user = yield User.find(1)
let game = yield Game.find(1)

let opinion = new Opinion

opinion.game().associate(game)
opinion.user().associate(user)

yield opinion.create()

Will add a tuple in the DB which has user_id = 1 and game_id = NULL, whereas reversing the association lines will add user_id = NULL and game_id = 1.

@thetutlage
Copy link
Member

Identified bug ,i will fix it

thetutlage added a commit that referenced this issue Oct 17, 2015
Lucid now supports multiple associate and dissociate under single write operation
@thetutlage thetutlage self-assigned this Oct 17, 2015
@thetutlage
Copy link
Member

Fixed as of v1.0.4

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

No branches or pull requests

2 participants