Class: ActiveRecord::Materialized::MaintenanceDeltaBuilder Private
- Inherits:
-
Object
- Object
- ActiveRecord::Materialized::MaintenanceDeltaBuilder
- Extended by:
- T::Sig
- Defined in:
- lib/activerecord/materialized/maintenance_delta_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Derives the affected partition keys for a write from its ActiveRecord change payload.
Instance Method Summary collapse
- #build ⇒ Object private
-
#initialize(change, key_columns) ⇒ MaintenanceDeltaBuilder
constructor
private
A new instance of MaintenanceDeltaBuilder.
Constructor Details
#initialize(change, key_columns) ⇒ MaintenanceDeltaBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MaintenanceDeltaBuilder.
13 14 15 16 |
# File 'lib/activerecord/materialized/maintenance_delta_builder.rb', line 13 def initialize(change, key_columns) @change = change @key_columns = key_columns end |
Instance Method Details
#build ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 22 23 24 |
# File 'lib/activerecord/materialized/maintenance_delta_builder.rb', line 19 def build return MaintenanceDelta.full_partition if @key_columns.empty? tuples = extract_tuples tuples.empty? ? MaintenanceDelta.full_partition : MaintenanceDelta.scoped(tuples.uniq) end |