Sha256: 4859c966617a7adb10ad57af4f8813b5db060a2ad4155ff4e8cd0fb15168a7eb
Contents?: true
Size: 327 Bytes
Versions: 15
Compression:
Stored size: 327 Bytes
Contents
module ActiveRecordCommaTypeCast def cast_value(value) if value.is_a?(String) super value.gsub(",", ".").gsub(/[^-0-9\.]/, "") else super value end end end ActiveRecord::Type::Decimal.send(:prepend, ::ActiveRecordCommaTypeCast) ActiveRecord::Type::Float.send(:prepend, ::ActiveRecordCommaTypeCast)
Version data entries
15 entries across 15 versions & 1 rubygems