Class: ForestRails::SchemaAdapter
- Inherits:
-
Object
- Object
- ForestRails::SchemaAdapter
- Defined in:
- app/services/forest_rails/schema_adapter.rb
Instance Method Summary collapse
-
#initialize(model) ⇒ SchemaAdapter
constructor
A new instance of SchemaAdapter.
- #perform ⇒ Object
Constructor Details
#initialize(model) ⇒ SchemaAdapter
Returns a new instance of SchemaAdapter.
4 5 6 |
# File 'app/services/forest_rails/schema_adapter.rb', line 4 def initialize(model) @model = model end |
Instance Method Details
#perform ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/services/forest_rails/schema_adapter.rb', line 8 def perform @collection = Collection.new({ name: @model.name.tableize, fields: [] }) add_columns add_associations @collection end |