Sha256: 5461bce1f36f9332f40d822f4f6912f77e302ecad7aa38159720c80b82e89adc
Contents?: true
Size: 416 Bytes
Versions: 17
Compression:
Stored size: 416 Bytes
Contents
module CsvRowModel module Validators class NumberValidator < ActiveModel::EachValidator # :nodoc: def before_after_decimal(value) value ||= "" # if value == "0003434.1233000" # before = "3434"; after = "1233" before, decimal, after = value.partition(".") before.sub!(/\A0+/, "") after.sub!(/0+\z/, "") [before, after] end end end end
Version data entries
17 entries across 17 versions & 1 rubygems