Class: NcsNavigator::Warehouse::Transformers::ForeignKeyIndex::DatabaseKeyProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/ncs_navigator/warehouse/transformers/foreign_key_index/database_key_provider.rb

Overview

Provides existing key lists out of the configured DataMapper "working" repo.

Instance Method Summary collapse

Instance Method Details

#existing_keys(model_class) ⇒ Object



9
10
11
12
13
# File 'lib/ncs_navigator/warehouse/transformers/foreign_key_index/database_key_provider.rb', line 9

def existing_keys(model_class)
  ::DataMapper.repository(:mdes_warehouse_working).adapter.select(
    "SELECT #{model_class.key.first.name} FROM #{model_class.mdes_table_name}"
  )
end