November 22, 2006


[Rails 筆記] tinyint ?以文找文

MySQL table 中欄位屬性如果為 tinyint(1) , Rails 會自動視其為 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:

ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false




Posted by at 天空部落 │12:02 │回應(0)引用(0)Programming
相關閱讀

引用URL

http://blog.yam.com/syshen/trackback/6735962
回應文章