Class: ForestLiana::ApimapsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/forest_liana/apimaps_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_user_from_jwt, #current_user, #serialize_model, #serialize_models

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/forest_liana/apimaps_controller.rb', line 5

def index
  result = []

  SchemaUtils.tables_names.map do |table_name|
    model = SchemaUtils.find_model_from_table_name(table_name)
    result << SchemaAdapter.new(model).perform if model.try(:table_exists?)
  end

  render json: serialize_models(result)
end