Skip to content

Commit

Permalink
fix BigDecimal coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-silva committed May 21, 2021
1 parent 978fe65 commit 33013f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sorbet-coerce/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def _convert_simple(value, type, raise_coercion_error)
safe_type_rule = SafeType::Boolean.strict
elsif value.is_a?(type)
return value
elsif type == BigDecimal
return BigDecimal(value)
elsif PRIMITIVE_TYPES.include?(type)
safe_type_rule = SafeType.const_get(type.name).strict
else
Expand Down

0 comments on commit 33013f1

Please # to comment.