Fix rational to decimal on type_cast_from_user

We ran into a problem with Rationals and the `Decimal#cast_value` method. 
For a `Rational` type, use a precision or fallback to default `BigDecimal.new(value, 0)`

@Overbryd and @marianovalles
The problem with this code `case` statement uses `===` when comparing for classes. Therefore the unit test fails.
This code works:
```ruby
def cast_value(value)
  case value
  when Numeric, String, Rational
    BigDecimal(value, precision.to_i)
  when proc { value.respond_to?(:to_d) }
    value.to_d
  else
    cast_value(value.to_s)
  end
end
```