Module: ActiveRecord::Materialized::Metadata::MaintenancePayload Private

Defined in:
lib/activerecord/materialized/metadata/maintenance_payload.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Reads and writes the serialized pending-maintenance payload on the metadata row.

Class Method Summary collapse

Class Method Details

.clear!(metadata) ⇒ 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.



21
22
23
# File 'lib/activerecord/materialized/metadata/maintenance_payload.rb', line 21

def self.clear!()
  .record.update!(maintenance_payload: nil)
end

.fetch(metadata) ⇒ 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.



14
15
16
17
18
19
# File 'lib/activerecord/materialized/metadata/maintenance_payload.rb', line 14

def self.fetch()
  raw = .record.maintenance_payload
  return nil if raw.blank?

  JSON.parse(raw)
end

.record!(metadata, payload) ⇒ 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.



10
11
12
# File 'lib/activerecord/materialized/metadata/maintenance_payload.rb', line 10

def self.record!(, payload)
  .record.update!(maintenance_payload: payload.to_json)
end