Support of foreign key db constraints were added with using of foreigner gem

Example:  
  belongs_to :person
  index :person_id, :foreign=> true

For tests please use DB=mysql2 bundle exec rake.