Skip to content

A platform for community discussion. Free, open, simple.

FIX: Validate auto_close_hours category setting

David Taylor19c9a6699a7d
diff --git a/app/models/category.rb b/app/models/category.rb
index e857f3dcbdf..959fe8e724f 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -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