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

Make #update_attributes behavior identical to #update #98

Merged
merged 1 commit into from
Dec 13, 2017

Conversation

ebihara99999
Copy link
Contributor

This is the PR for the issue#87
See there for details.

Another choice of implemention is like this:

@model.class.find_by(:"#{primary_key}" =>
@model.send(:"#{primary_key}")).update(attrs)

but for some reasons I don't adopt it.
First it makes 2 queries instead of one.
Secondly it has potential risk to race conditions.

Another choice of implemention is like this:

```
@model.class.find_by(:"#{primary_key}" =>
@model.send(:"#{primary_key}")).update(attrs)
```

but for some reasons I don't adopt it.
First it makes 2 queries instead of one.
Secondly it has potential risk to race conditions.
@Ch4s3
Copy link
Contributor

Ch4s3 commented Dec 13, 2017

closes #87

@Ch4s3
Copy link
Contributor

Ch4s3 commented Dec 13, 2017

Thanks @ebihara99999!!!

@Ch4s3 Ch4s3 merged commit be614ba into Sorcery:master Dec 13, 2017
@ebihara99999 ebihara99999 deleted the fix/update_attributes_behavior branch December 10, 2018 07:16
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.

2 participants