Module: BMC::ActiveModelTypeCast::Decimal

Defined in:
lib/bmc/active_model_type_cast.rb

Instance Method Summary collapse

Instance Method Details

#cast_value(value) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/bmc/active_model_type_cast.rb', line 3

def cast_value(value)
  if value.is_a?(String)
    super(value.tr(",", ".").gsub(/[^-0-9.]/, ""))
  else
    super(value)
  end
end