feat(svr): enablable from configuration

This commit is contained in:
Colin Darie 2023-07-27 17:35:01 +02:00
parent c9bde31ef2
commit 69e673e47e
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
3 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ class SVASVRConfiguration
UNIT_OPTIONS = ['days', 'weeks', 'months']
RESUME_OPTIONS = ['continue', 'reset']
validates :decision, inclusion: { in: DECISION_OPTIONS.without('svr') }
validates :decision, inclusion: { in: DECISION_OPTIONS }
validates :period, presence: true, numericality: { only_integer: true }, if: -> { enabled? }
validates :unit, presence: true, inclusion: { in: UNIT_OPTIONS }, if: -> { enabled? }
validates :resume, presence: true, inclusion: { in: RESUME_OPTIONS }, if: -> { enabled? }