Module RailsERD::Diagram::Graphviz::Bachman

  1. lib/rails_erd/diagram/graphviz.rb

Methods

public instance

  1. relationship_style

Included modules

  1. Simple

Public instance methods

relationship_style (relationship)
[show source]
# File lib/rails_erd/diagram/graphviz.rb, line 108
        def relationship_style(relationship)
          {}.tap do |options|
            options[:style] = :dotted if relationship.indirect?

            # Participation is "look-here".
            dst = relationship.source_optional? ? "odot" : "dot"
            src = relationship.destination_optional? ? "odot" : "dot"

            # Cardinality is "look-across".
            dst << "normal" if relationship.to_many?
            src << "normal" if relationship.many_to?
            options[:arrowsize] = 0.6
            options[:arrowhead], options[:arrowtail] = dst, src
          end
        end