Class: OnlineMigrations::BackgroundMigrations::BackfillCallRecordRecordingSource

Inherits:
OnlineMigrations::BackgroundMigration
  • Object
show all
Defined in:
lib/online_migrations/background_migrations/backfill_call_record_recording_source.rb

Overview

Backfill recording_source = 'switchvox' for existing CallRecords with NULL
This ensures the recording source filter works correctly for both sources

Delegated Instance Attributes collapse

Instance Method Summary collapse

Instance Method Details

#countObject

Alias for Relation#count

Returns:

  • (Object)

    Relation#count

See Also:



16
# File 'lib/online_migrations/background_migrations/backfill_call_record_recording_source.rb', line 16

delegate :count, to: :relation

#process_batch(call_records) ⇒ Object



12
13
14
# File 'lib/online_migrations/background_migrations/backfill_call_record_recording_source.rb', line 12

def process_batch(call_records)
  call_records.update_all(recording_source: 'switchvox')
end

#relationObject



8
9
10
# File 'lib/online_migrations/background_migrations/backfill_call_record_recording_source.rb', line 8

def relation
  CallRecord.where(recording_source: nil)
end