Method: OceanDynamo::Tables::ClassMethods#establish_db_connection

Defined in:
lib/ocean-dynamo/tables.rb

#establish_db_connectionObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ocean-dynamo/tables.rb', line 46

def establish_db_connection
  setup_dynamo
  if table_exists?(dynamo_table)
    wait_until_table_is_active
    self.table_connected = true
    update_table_if_required
  else
    raise(TableNotFound, table_full_name) unless table_create_policy
    create_table
  end
end