Module: Mongify::Translation::Sync

Included in:
Mongify::Translation
Defined in:
lib/mongify/translation/sync.rb

Defined Under Namespace

Classes: SyncHelperMigrator

Constant Summary collapse

DRAFT_KEY =
"__mongify_sync_draft__"
SYNC_HELPER_TABLE =
"__mongify_sync_helper__"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_updated_atObject

Returns the value of attribute max_updated_at.



9
10
11
# File 'lib/mongify/translation/sync.rb', line 9

def max_updated_at
  @max_updated_at
end

Instance Method Details

#sync(sql_connection, no_sql_connection) ⇒ Object

Does the actual act of sync processing the translation. Takes in both a sql connection and a no sql connection



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mongify/translation/sync.rb', line 25

def sync(sql_connection, no_sql_connection)
  prepare_connections(sql_connection, no_sql_connection)
  setup_sync_table
  setup_db_index
  sync_data
  set_last_updated_at
  copy_embedded_tables
  sync_update_reference_ids
  copy_polymorphic_tables
  nil
end