fix: issues and pull_request length calculate

This commit is contained in:
2022-05-06 17:25:34 +08:00
parent 6aa3321d17
commit 000197b0d1
6 changed files with 17 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ class JournalsController < ApplicationController
normal_status(-1, "评论内容不能为空")
else
ActiveRecord::Base.transaction do
Journals::CreateForm.new({notes: notes.to_s.strip}).validate!
Journals::CreateForm.new({notes: notes.to_s.strip.b}).validate!
journal_params = {
journalized_id: @issue.id ,
journalized_type: "Issue",
@@ -75,7 +75,7 @@ class JournalsController < ApplicationController
def update
content = params[:content]
if content.present?
Journals::UpdateForm.new({notes: notes.to_s.strip}).validate!
Journals::UpdateForm.new({notes: notes.to_s.strip.b}).validate!
if @journal.update_attribute(:notes, content)
normal_status(0, "更新成功")
else