debian-mirror-gitlab/lib/gt_one_coercion.rb

8 lines
125 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2014-09-02 18:07:02 +05:30
class GtOneCoercion < Virtus::Attribute
def coerce(value)
[1, value.to_i].max
end
end