diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
commit | b326e82dc012d81e9698cb1f402502af1788c1e9 (patch) | |
tree | 6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /activemodel/lib/active_model/type | |
parent | 80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff) | |
download | rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2 rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip |
applies remaining conventions across the project
Diffstat (limited to 'activemodel/lib/active_model/type')
-rw-r--r-- | activemodel/lib/active_model/type/decimal.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/activemodel/lib/active_model/type/decimal.rb b/activemodel/lib/active_model/type/decimal.rb index 273798593b..6266933636 100644 --- a/activemodel/lib/active_model/type/decimal.rb +++ b/activemodel/lib/active_model/type/decimal.rb @@ -17,16 +17,16 @@ module ActiveModel def cast_value(value) casted_value = case value - when ::Float - convert_float_to_big_decimal(value) - when ::Numeric, ::String - BigDecimal(value, precision.to_i) + when ::Float + convert_float_to_big_decimal(value) + when ::Numeric, ::String + BigDecimal(value, precision.to_i) else - if value.respond_to?(:to_d) - value.to_d - else - cast_value(value.to_s) - end + if value.respond_to?(:to_d) + value.to_d + else + cast_value(value.to_s) + end end apply_scale(casted_value) |