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
Fixes #29482 - favor update over update_attributes #497
Conversation
Issues: #29482 |
Let's wait for #498 and fix theese by rubocop. |
[test foreman_discovery] |
Fixes at least the |
Isn't this a semantic change? https://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute This is the fastest way to update attributes because it goes straight to the database, but take into account that in consequence the regular update procedures are totally bypassed. In particular: Validations are skipped. Callbacks are skipped. But. https://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update Updates the attributes of the model from the passed-in hash and saves the record, all wrapped in a transaction. If the object is invalid, the saving will fail and false will be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ondra explained to me that I actually thought update_columns
. Yeah, let's unblock this.
@lzap it's |
For the record, these guys are failing:
|
I can fix the discovery rules easily:
Not sure about that JS one, I don't see it locally. |
@lzap The JS test was transient. Rails 5 is green and Rails 6 failing with the three errors you listed above: https://ci.theforeman.org/job/test_plugin_matrix/1950/ |
update_attributes
got deprecated in Rails 6.0