Class: Woods::Notion::Mappers::MigrationMapper
- Inherits:
-
Object
- Object
- Woods::Notion::Mappers::MigrationMapper
- Defined in:
- lib/woods/notion/mappers/migration_mapper.rb
Overview
Extracts latest migration dates per table from migration ExtractedUnits.
Used to update Data Models pages with the most recent schema change date.
Instance Method Summary collapse
-
#latest_changes(migration_units) ⇒ Hash<String, String>
Compute the latest migration date for each affected table.
Instance Method Details
#latest_changes(migration_units) ⇒ Hash<String, String>
Compute the latest migration date for each affected table.
20 21 22 23 24 25 26 27 28 |
# File 'lib/woods/notion/mappers/migration_mapper.rb', line 20 def latest_changes(migration_units) migration_units.each_with_object({}) do |unit, changes| extracted_at = unit['extracted_at'] next unless extracted_at tables = (unit['metadata'] || {})['tables_affected'] || [] tables.each { |table| update_latest(changes, table, extracted_at) } end end |