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

Bug updating the resource after a save #176

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AgarFu
Copy link

@AgarFu AgarFu commented Sep 11, 2016

If the attribute to update is a hash and it is nill, then the wrong
attributes are being updated.

I found this bug while I was updating the assignee in an issue without
assignee. In that case, with this code:

issue.save!('fields' => { 'assignee' => user.attrs }) if issue.assignee.nil?

All the attributes of the user are being set to the issue,
for instance the issue.id becomes user.id, etc ...

This patch solves the issue and pases all the tests.

If the attribute to update is a hash and it is nill, then the wrong
attributes are being updated.

I found this bug while I was updating the assignee in an issue without
assignee. In that case, with this code:

issue.save!('fields' => { 'assignee' => user.attrs }) if issue.assignee.nil?

in this case, all the attributes of the user are being set to the issue,
for instance the issue.id becomes user.id, etc ...

This patch solves the issue and pases all the tests.
@bobbrodie bobbrodie added in progress Bug Broken functionality labels Nov 13, 2016
@SimonMiaou
Copy link
Collaborator

@AgarFu Could you add a test so we can merge it?

@SimonMiaou SimonMiaou self-assigned this Jul 21, 2017
@SimonMiaou
Copy link
Collaborator

@AgarFu Hey, I merge develop and solve the conflict.
I'd like to merge this PR this week as it is blocking some user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants