update_all is one of many methods that skip checks and callbacks. Therefore, any ActiveRecord checks will simply not be executed when update_all called.
However, if the update_all call does not meet database-level constraints or otherwise throws an exception in your database, then ActiveRecord will throw an ActiveRecord::StatementInvalid exception and will interrupt with update_all without returning a value like any other exception.
Other ActiveRecord methods that skip checks include:
- decrement!
- decment_counter
- increase!
- increment_counter
- toggle switch!
- click
- update_attribute
- update_column
- update_counters
source share