Rails Plugin: Superdumper, helps you visualize your database schema

You know the problem. You are agile like hell. You don’t bother doing complicated diagrams to show somebody what you’re doing. That’s okay. But sometimes, you need to show off what you’ve been struggling with, and if that day comes, this little rakefile can save some time.

Simply , Unpack this file ( tar bz btw ) in your rails app’s root folder and call rake db:superdumper. This will create a file called database.dot in your root folder, containing your database scheme, including associations, in the so-called “dot” format, used by the open-source GraphViz package as input. If you don’t have that package, install it, via ports or apt or whatever applies to your platform. 

In Detail what you have to do is here ( assuming you unpacked the file already.. )
 

rake db:superdumper

This task will automatically dump your scheme and call GraphViz, resulting in a pdf file in the root of your app with the name database.pdf. If it’s not your database schema smiling at you, let me know.

  • http://www.not404.com Laurence A. Lee

    Nice results, thanks for sharing. I had to tweak this to get it to run on Rails 2.1.0, to avoid getting a “uninitialized constant ActiveSupport:Inflector” error. At line 34:

     outfile << "#{x}:#{Inflector.foreign_key(a.name)} -- #{a.class_name}:id;n"
    
    • http://momo.brauchtman.net momo

      should’ve mentioned that I’m
      - using Rails 2.2.2
      - not the best rubyist around, so excuse my inability to check for compatibility :-)