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

Run SQL only if attribute changed for update_attribute method #18501

Merged
merged 1 commit into from
Jan 18, 2015

Conversation

prathamesh-sonpatki
Copy link
Member

@vipulnsward
Copy link
Member

LGTM. I think we should add CHANGELOG

@prathamesh-sonpatki
Copy link
Member Author

Right. Just wanted to get some eyes before adding changelog

@prathamesh-sonpatki
Copy link
Member Author

@rafaelfranca What do you think

@spastorino
Copy link
Contributor

Looks good, please add a CHANGELOG entry

 - This is based on rails#18400 but
   tackling same issue with update_attribute method instead of update method.
@prathamesh-sonpatki
Copy link
Member Author

@spastorino Done.

spastorino added a commit that referenced this pull request Jan 18, 2015
 Run SQL only if attribute changed for update_attribute method
@spastorino spastorino merged commit e3f5be1 into rails:master Jan 18, 2015
@prathamesh-sonpatki prathamesh-sonpatki deleted the nosql branch January 19, 2015 03:20
kamipo added a commit that referenced this pull request Oct 4, 2018
`test_update_does_not_run_sql_if_record_has_not_changed` would pass
without #18501 since `assert_queries` ignores BEGIN/COMMIT unless
`ignore_none: true` is given.

Since #32647, empty BEGIN/COMMIT is ommited. So we no longer need to use
`assert_queries(0)` to ignore BEGIN/COMMIT in the queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants