Merge branch 'dev_forum' of https://gitlink.org.cn/Trustie/forgeplus into dev_forum

This commit is contained in:
yystopf 2024-01-12 14:24:30 +08:00
commit c9237e993e
2 changed files with 6 additions and 1 deletions

View File

@ -20,7 +20,7 @@ class Memo < ApplicationRecord
validates_presence_of :author_id, :subject,:content
# 若是主题帖,则内容可以是空
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
validates_length_of :subject, maximum: 50
validates_length_of :subject, maximum: 200
validate :cannot_reply_to_locked_topic, :on => :create

View File

@ -0,0 +1,5 @@
class ChangeMemosContentSize < ActiveRecord::Migration[5.2]
def change
execute("ALTER TABLE `memos` MODIFY `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")
end
end