You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes ActiveRecord to fail on NaN input with the error "FloatDomainError (NaN)"
Here's the full stack of this error from an older version fork we're using at harleyttd/rubyamf—I did a quick look through the current code and it appears this will still be an issue in the current model.rb, so I'm still reporting it for good measure.
This is a fairly large issue since Flash uses NaN extensively as an uninitialized Number value (as far as I can remember) and it's very likely that that will make it to ActiveRecord.
Interesting to note that previously Rails handled NaN incorrectly by instead assuming it was a Boolean in value.to_i rescue value ? 1 : 0 to convert it to an int (see line in diff above). This means (yikes) that NaN was interpreted as the number 1, since NaN is a true value in ruby, unless there was some workaround already in place that I'm not aware of.
Cross-posting this to rails/rails to let them decide if they will fix it by correctly handling NaN in ActiveRecord.
The text was updated successfully, but these errors were encountered:
See the change here:
rails/rails@v3.2.8...v3.2.10#L63L78
This causes ActiveRecord to fail on NaN input with the error "FloatDomainError (NaN)"
Here's the full stack of this error from an older version fork we're using at harleyttd/rubyamf—I did a quick look through the current code and it appears this will still be an issue in the current
model.rb
, so I'm still reporting it for good measure.This is a fairly large issue since Flash uses NaN extensively as an uninitialized Number value (as far as I can remember) and it's very likely that that will make it to ActiveRecord.
Interesting to note that previously Rails handled NaN incorrectly by instead assuming it was a Boolean in
value.to_i rescue value ? 1 : 0
to convert it to an int (see line in diff above). This means (yikes) that NaN was interpreted as the number 1, since NaN is a true value in ruby, unless there was some workaround already in place that I'm not aware of.Cross-posting this to rails/rails to let them decide if they will fix it by correctly handling NaN in ActiveRecord.
The text was updated successfully, but these errors were encountered: