Hotfix for Rails bug with NaN integer column values

See rails/rails#8757 - After the 'rescue' truthiness check was removed from integer column casting in 3.2.9 (which itself was a bug causing incorrect default values from Flash NaNs), this bug appeared raising an exception when NaN.to_i is called.

The temporary fix is to convert all NaN to nil which is correctly interpreted by Rails. This is what they end up being anyway, since the database adapter will convert NaN to NULL in all cases I know of.

Using my fork until this can be merged in, then we can switch back if you want :)