Skip to content

Document new solution for "Associations Don’t Appear in the ER Diagram" with tbls export from rails-erd #4111

Description

@arthaud-proust

Self Checks

URL

https://liambx.com/docs/parser/supported-formats/rails#when-associations-dont-appear-in-the-er-diagram

Current Text

A potential workaround—though it requires additional setup—is to manually add add_foreign_key statements to db/schema.rb in your CI/CD process, then run Liam CLI. This way, the diagram will reflect those associations.

Below is a conceptual example code snippet showing how you might gather table names from models with belongs_to associations and add foreign keys manually (note: this example is illustrative and may need adjustments for production use):

[...]

Suggested Improvement

As a solution, the rails-erd gem can load the Rails application and export relationships in TBLS format, which is handled by liam.

Reason for Suggestion

Simpler solution

Related References

voormedia/rails-erd#471

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions