Class: DbmlRelationsFormatter
- Inherits:
-
Object
- Object
- DbmlRelationsFormatter
- Defined in:
- lib/schema_to_dbml/dbml_relations_formatter.rb
Instance Method Summary collapse
-
#format(from_table:, to_table:, column: nil, on_delete: nil) ⇒ String
Formats a database relationship for a DBML file.
Instance Method Details
#format(from_table:, to_table:, column: nil, on_delete: nil) ⇒ String
Formats a database relationship for a DBML file
14 15 16 17 18 19 20 21 22 |
# File 'lib/schema_to_dbml/dbml_relations_formatter.rb', line 14 def format(from_table:, to_table:, column: nil, on_delete: nil) column ||= default_foreign_key_column(to_table) ref_name = generate_reference_name(from_table, to_table, column) ref = build_reference_string(ref_name, from_table, column, to_table) format_on_delete(ref, on_delete) ref end |