Rails sees mysql tinyint(1) as a boolean - but I want it to be a number
问题 Rails 4.2.1 using mysql2 gem. ActiveRecord treats a mysql column with data type tinyint(1) as a boolean. But I want to use it as a small number - I want to store values up to 100 which is ok for tinyint(1) . When I try to create a record, the tinyint column casts to false and I get a depreciation warning: > Foo.create(my_tinyint_col: 13) (0.2ms) BEGIN SQL (0.5ms) INSERT INTO `foos` (`my_tinyint_col`) VALUES (0) (107.3ms) COMMIT => #<Foo ID: 519, my_tinyint_col: false> DEPRECATION WARNING: You