FIX: Validate auto_close_hours category setting

This prevents server errors when the value is set too high
This commit is contained in:
David Taylor 2018-09-26 16:04:49 +01:00
parent e387adadf8
commit 19c9a6699a
1 changed files with 2 additions and 0 deletions

View File

@ -50,6 +50,8 @@ class Category < ActiveRecord::Base
validate :ensure_slug
validates :auto_close_hours, numericality: { greater_than: 0, less_than_or_equal_to: 87600 }, allow_nil: true
after_create :create_category_definition
before_save :apply_permissions