method
_update_record
v4.1.8 -
Show latest stable
- Class:
ActiveRecord::Relation
_update_record(values, id, id_was)public
No documentation available.
# File activerecord/lib/active_record/relation.rb, line 72
def _update_record(values, id, id_was) # :nodoc:
substitutes, binds = substitute_values values
scope = @klass.unscoped
if @klass.finder_needs_type_condition?
scope.unscope!(where: @klass.inheritance_column)
end
um = scope.where(@klass.arel_table[@klass.primary_key].eq(id_was || id)).arel.compile_update(substitutes, @klass.primary_key)
@klass.connection.update(
um,
'SQL',
binds)
end