module Gummi module DbLayer module Fields class PositiveInteger < Virtus::Attribute def coerce(value) coerced = value.to_i if coerced > 0 coerced else default_value.value end end def mapping { type: 'integer' } end end end end end