Class: RailsERD::Diagram::Tbls

Inherits:
Diagram
  • Object
show all
Defined in:
lib/rails_erd/diagram/tbls.rb

Overview

Emits a JSON description of the domain in the tbls schema format (https://github.com/k1LoW/tbls). Consumable by any tbls-compatible tool — for example Liam ERD: liam erd build --input erd.json --format tbls.

Unlike a schema.rb dump, this reflects the relationships rails-erd derives from ActiveRecord — including FKs that exist only as belongs_to associations and not as DB-level constraints.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tables_by_nameObject

Returns the value of attribute tables_by_name.



16
17
18
# File 'lib/rails_erd/diagram/tbls.rb', line 16

def tables_by_name
  @tables_by_name
end

Instance Method Details

#filenameObject



48
49
50
# File 'lib/rails_erd/diagram/tbls.rb', line 48

def filename
  "#{options.filename}.json"
end