Rails ERD and Padrino

I was searching for a data modeling tool to visualize a project's database structure and I came across the rails-erd gem that fits the bill perfectly. The only downside is that the project that I wanted to use this on is using Padrino and not Rails. Fortunately, on the rails-erd site they have some instructions for using it outside of a Rails project. So below is an adaption of those instructions for use in a Padrino project.

Step 1: Add the gem to your Gemfile (and run `bundle`)

Step 2: Create a Rake task to generate the visualization

Create a /tasks/erd.rake file and add the code below to it:

You will need to create a docs folder in the root of your project or remove the filename: Padrino.root('docs/erd') from the Rake task