Kwatable is a pretty tool to generate SQL and DTO from database table definition. Kwatable reads table definition written in YAML, and generates 'create table' SQL script for MySQL and PostgreSQL, or generates DTO class file for Java and Ruby. You can add your own eRuby template.
Gemfile gem 'kwatable', '~> 0.3.0'
install gem install kwatable