Permalink
Browse files

Update lib/mongoid/fields/internal/big_decimal.rb

Account for 'NaN' which is valid for BigDecimal, but not for Float.
  • Loading branch information...
Nkem authored and durran committed Feb 20, 2013
1 parent 8fb27a8 commit 0f4aabc16e5da793f65c20baca2cc264d42938a7
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongoid/fields/internal/big_decimal.rb
@@ -21,7 +21,7 @@ class BigDecimal
def deserialize(object)
return object unless object
begin
Float(object)
Float(object) unless object == 'NaN'
::BigDecimal.new(object)
rescue ArgumentError, TypeError
object

0 comments on commit 0f4aabc

Please sign in to comment.