Module: ActiveRecord::DataClassification::TableSpace

Defined in:
lib/active_record/data_classification/table_space.rb

Class Method Summary collapse

Class Method Details

.all_tablesObject



7
8
9
# File 'lib/active_record/data_classification/table_space.rb', line 7

def all_tables
  @all_tables ||= connection.select_rows("select distinct(TABLE_NAME) from information_schema.columns where TABLE_SCHEMA='#{schema}'").flatten
end

.connectionObject



11
12
13
# File 'lib/active_record/data_classification/table_space.rb', line 11

def connection
  ActiveRecord::Base.connection
end

.schemaObject



15
16
17
# File 'lib/active_record/data_classification/table_space.rb', line 15

def schema
  connection.config[:database]
end