From 526b9aab0cb04e5272b58cafff89a377139e5b9e Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 16 Jan 2019 12:10:07 +0100 Subject: [PATCH] [bug] unable to create/edit plan of 12 months/53 weeks --- app/models/plan.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/plan.rb b/app/models/plan.rb index 3f64a76a8..b188cf80e 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -27,8 +27,8 @@ class Plan < ActiveRecord::Base validates :amount, :group, :base_name, presence: true validates :interval_count, numericality: { only_integer: true, greater_than_or_equal_to: 1 } - validates :interval_count, numericality: { less_than: 12 }, if: proc { |plan| plan.interval == 'month' } - validates :interval_count, numericality: { less_than: 52 }, if: proc { |plan| plan.interval == 'week' } + validates :interval_count, numericality: { less_than: 13 }, if: proc { |plan| plan.interval == 'month' } + validates :interval_count, numericality: { less_than: 53 }, if: proc { |plan| plan.interval == 'week' } validates :interval, inclusion: { in: %w[year month week] } validates :base_name, :slug, presence: true