I just noticed that in ActiveRecord::ConnectionAdapters::Column.type_cast (and type_cast_code) the type casting for float columns simply does value.to_f, whereas all the others have a rescue or call out to a method, the default implementations of which have rescues or enough logic in that I don’t think they’d fail.
Imagine the following:
create_table :vehicle do |t|
Now, doing some archaeology on trac, I’ve found that the rescue for integer columns was added way back in changeset 928  based on ticket 820 . Putting a rescue block on the type cast would be nice and consistent, and simple, so I can create a patch for this easily. However, I haven’t created a patch for this super-tiny thing as I don’t really know if it’s intentionally missing or not. I just want some feedback on if this is expected behaviour or not before I patch it up (and deal with the no-doubt cascade of failing tests from changing the behaviour).
If it’s expected behaviour I’ll just patch my version of rails for this app.