instance method _build_update_manager

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

_build_update_manager(values, constraints)

No documentation comment.

Parameters

values req
constraints req
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

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close