ARはMySQLでtinyint(1)をbooleanにエミュレートする

メモ。

By default, the MysqlAdapter will consider all columns of type tinyint(1) as boolean. If you wish to disable this emulation (which was the default behavior in versions 0.13.1 and earlier) you can add the following line to your environment.rb file:

http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/MysqlAdapter.html

回避するときは

  ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false


うーん、どうしようかなぁ…。
truefalseだけじゃ足りないけどintegerは勿体ない、みたいなカラムがある。

  1. boolean
  2. tinyint
  3. integer

現状のmigrationだと2を3に合わせる必要がある。
このオプションをオンにすると、1を2に合わせてやる必要があるんだろうな。