1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/validators/good_big_text_validator.rb

15 lines
310 B
Ruby
Raw Normal View History

2019-09-29 09:23:06 -04:00
# frozen_string_literal: true
class GoodBigTextValidator < GoodTextValidator
class Validation < Validation
MIN = 1
MAX = 10_000
def perform
super
2019-09-30 07:52:46 -04:00
error :too_short, count: MIN if value.to_s.length < MIN
error :too_long, count: MAX if value.to_s.length > MAX
2019-09-29 09:23:06 -04:00
end
end
end