validate max length of forum topic

This commit is contained in:
r888888888
2017-03-06 15:13:20 -08:00
parent 8b6441a4da
commit 7f2ad3c80b

View File

@@ -25,6 +25,7 @@ class ForumTopic < ActiveRecord::Base
validates_associated :original_post
validates_inclusion_of :category_id, :in => CATEGORIES.keys
validates_inclusion_of :min_level, :in => MIN_LEVELS.values
validates :title, :length => {:maximum => 255}
accepts_nested_attributes_for :original_post
after_update :update_orignal_post