voormedia / rails-erd

Generate Entity-Relationship Diagrams for Rails applications
http://voormedia.github.io/rails-erd/
MIT License
4k stars 367 forks source link

document auto-generate features #162

Open kerrizor opened 9 years ago

kerrizor commented 9 years ago

Added by #148 the auto-generate feature will, when installed, generate a new ERD whenever rake db:migrate is invoked in development.

cherimarie commented 9 years ago

screen shot 2015-10-23 at 1 21 46 pm

We can't get this feature to work, on any of three projects we tried it in. So maybe we need documentation before we can write documentation? :)

Also, does documentation for features like this go in the README or the Jekyll site?

mintuhouse commented 8 years ago

There a couple of changes that need to be made before it works.

  1. In auto_generate_diagram.rake, Erd is undefined. It should be changed to RailsErd.load_tasks
  2. And define load_tasks in rails_erd.rb
  def self.loaded_tasks=(val); @loaded_tasks = val; end
  def self.loaded_tasks; return @loaded_tasks; end

  def self.load_tasks
    return if(self.loaded_tasks)
    self.loaded_tasks = true

    Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
  end

Note: See annotate for original implementation

  1. Also in auto_generate_diagram.rake, either we need to define a rake task erd:default or change that line to bundle exec erd

Note: Configuring can now only be done via .erdconfig. Ideal way I suppose would be invoke CLI and allow config as part of template rake task

nielspetersen commented 8 years ago

We've listed this issue within the 14th RubyIssues. https://rubyissues.ongoodbits.com/. :gem: We keep our fingers crossed!