instance method
_update_record
Ruby on Rails 5.0.7.2
Since v4.0.13 Private — implementation detail, not part of the public APISignature
_update_record(attribute_names = self.attribute_names)
Updates the associated record with values matching those of the instance attributes. Returns the number of affected rows.
Parameters
-
attribute_namesopt = self.attribute_names
Source
# File activerecord/lib/active_record/persistence.rb, line 554
def _update_record(attribute_names = self.attribute_names)
attributes_values = arel_attributes_with_values_for_update(attribute_names)
if attributes_values.empty?
rows_affected = 0
else
rows_affected = self.class.unscoped._update_record attributes_values, id, id_was
end
yield(self) if block_given?
rows_affected
end
Defined in activerecord/lib/active_record/persistence.rb line 554
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence