module RailsERD

Welcome to the API documentation of Rails ERD. If you wish to extend or customise the output that is generated by Rails ERD, you have come to the right place.

Creating custom output

If you want to create your own kind of diagrams, or some other output, a good starting point is the RailsERD::Diagram class. It can serve as the base of your output generation code.

Options

Rails ERD provides several options that allow you to customise the generation of the diagram and the domain model itself. For an overview of all options available in Rails ERD, see README.rdoc.

You can specify the option on the command line if you use Rails ERD with Rake:

% rake erd orientation=vertical title='My model diagram'

When using Rails ERD from within Ruby, you can set the options on the RailsERD namespace module:

RailsERD.options.orientation = :vertical
RailsERD.options.title = "My model diagram"

Constants

VERSION

Attributes

options[RW]

Access to default options. Any instance of RailsERD::Domain and RailsERD::Diagram will use these options unless overridden.

Public Class Methods

default_options() click to toggle source
# File lib/rails_erd.rb, line 37
def default_options
  ActiveSupport::OrderedOptions[
    :attributes, :content,
    :disconnected, true,
    :filename, "erd",
    :filetype, :pdf,
    :fonts, {},
    :indirect, true,
    :inheritance, false,
    :markup, true,
    :notation, :simple,
    :orientation, :horizontal,
    :polymorphism, false,
    :sort, true,
    :warn, true,
    :title, true,
    :exclude, nil,
    :only, nil,
    :only_recursion_depth, nil,
    :prepend_primary, false,
    :cluster, false,
  ]
end
load_tasks() click to toggle source
# File lib/rails_erd.rb, line 64
def load_tasks
  return if(self.loaded_tasks)
  self.loaded_tasks = true

  Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
end
loaded_tasks() click to toggle source
# File lib/rails_erd.rb, line 62
def loaded_tasks; return @loaded_tasks; end
loaded_tasks=(val) click to toggle source
# File lib/rails_erd.rb, line 61
def loaded_tasks=(val); @loaded_tasks = val; end