Class: ForestLiana::SchemaAdapter

Inherits:
Object
  • Object
show all
Defined in:
app/services/forest_liana/schema_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ SchemaAdapter

Returns a new instance of SchemaAdapter.



3
4
5
# File 'app/services/forest_liana/schema_adapter.rb', line 3

def initialize(model)
  @model = model
end

Instance Method Details

#performObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/forest_liana/schema_adapter.rb', line 7

def perform
  @collection = ForestLiana::Collection.new({
    name: @model.name.tableize,
    fields: []
  })

  add_columns
  add_associations

  @collection
end