DrySQL uses your DB's information schema to identify keys, and generate associations and validations for ActiveRecord objects. You defined the schema on your DB ... don't re-define it in your application code. Legacy DB Tables, Ruby Desktop apps, Rails apps...DrySQL's got all your databases covered
Gemfile gem 'drysql', '~> 0.1.7'
install gem install drysql -v 0.1.7