instance method
_build_update_manager
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
_build_update_manager(values, constraints)
No documentation comment.
Parameters
-
valuesreq -
constraintsreq
Source
# File activerecord/lib/active_record/persistence.rb, line 287
def _build_update_manager(values, constraints)
constraints = constraints.map { |name, value| predicate_builder[name, value] }
default_constraint = build_default_constraint
constraints << default_constraint if default_constraint
if current_scope = self.global_current_scope
constraints << current_scope.where_clause.ast
end
Arel::UpdateManager.new(arel_table).tap do |update_manager|
update_manager.set(values.transform_keys { |name| arel_table[name] })
update_manager.wheres = constraints
end
end
Defined in activerecord/lib/active_record/persistence.rb line 287
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence::ClassMethods