Fix #3246: Require nonblank body for wiki pages.

This commit is contained in:
evazion
2017-07-29 14:59:42 -05:00
parent 4b635628cc
commit 1000f8d2e2

View File

@@ -10,6 +10,7 @@ class WikiPage < ApplicationRecord
belongs_to :updater, :class_name => "User"
validates_uniqueness_of :title, :case_sensitive => false
validates_presence_of :title
validates_presence_of :body, :unless => -> { is_deleted? || other_names.present? }
validate :validate_rename
validate :validate_locker_is_builder
validate :validate_not_locked