Class: Dbee::SchemaFromTreeBasedModel

Inherits:
Object
  • Object
show all
Defined in:
lib/dbee/schema_from_tree_based_model.rb

Overview

Converts a tree based model to a Schema. Note that this results in a different but compatible schema compared to the result of generating a Dbee::Schema by calling to_schema on a Dbee::Base class. This is because converting from a tree based model is a lossy.

Class Method Summary collapse

Class Method Details

.convert(tree_model) ⇒ Object



17
18
19
# File 'lib/dbee/schema_from_tree_based_model.rb', line 17

def convert(tree_model)
  Schema.new(to_graph_based_models(tree_model))
end