修改了描述

This commit is contained in:
sylor_huang@126.com 2020-04-06 14:32:21 +08:00
parent bb0ce95666
commit a6b7fa02b7
2 changed files with 124 additions and 123 deletions

View File

@ -42,7 +42,7 @@ class Issue < ApplicationRecord
new_attachment_name = self.attachments.select(:filename,:id).where(id: issue_files).pluck(:filename).join(",")
journal.journal_details.create(property: "attachment", prop_key: "#{issue_files.size}", old_value: old_attachment_names, value: new_attachment_name)
end
change_values = %w(subject is_private assigned_to_id tracker_id status_id priority_id fixed_version_id start_date due_date estimated_hours done_ratio issue_tags_value issue_type token branch_name)
change_values = %w(subject description is_private assigned_to_id tracker_id status_id priority_id fixed_version_id start_date due_date estimated_hours done_ratio issue_tags_value issue_type token branch_name)
change_values.each do |at|
if self.send("saved_change_to_#{at}?")
journal.journal_details.create(property: "attr", prop_key: "#{at}", old_value: self.send("#{at}_before_last_save"), value: self.send(at))

View File

@ -19,7 +19,6 @@ class Journal < ApplicationRecord
details = self.journal_details.select(:property, :prop_key, :old_value, :value).pluck(:property, :prop_key, :old_value, :value)
if details.size > 0
details.each do |de|
unless de[1].to_s == "description"
if de[0] == "attr"
content = ""
else
@ -32,6 +31,9 @@ class Journal < ApplicationRecord
else
prop_name = I18n.t("journal_detail.#{de[1]}")
case de[1]
when "description"
old_value = "描述已更新"
value = "修改了描述"
when "is_private"
old_value = I18n.t("journal_detail.#{de[2]}")
value = I18n.t("journal_detail.#{de[3]}")
@ -144,7 +146,6 @@ class Journal < ApplicationRecord
end
end
end
end
send_details
end