|
|
|
@@ -23,6 +23,7 @@ class JournalsController < ApplicationController |
|
|
|
normal_status(-1, "评论内容不能为空") |
|
|
|
else |
|
|
|
ActiveRecord::Base.transaction do |
|
|
|
Journals::CreateForm.new({notes: notes.to_s.strip}).validate! |
|
|
|
journal_params = { |
|
|
|
journalized_id: @issue.id , |
|
|
|
journalized_type: "Issue", |
|
|
|
@@ -53,6 +54,9 @@ class JournalsController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
rescue Exception => exception |
|
|
|
puts exception.message |
|
|
|
normal_status(-1, exception.message) |
|
|
|
end |
|
|
|
|
|
|
|
def destroy |
|
|
|
@@ -70,7 +74,8 @@ class JournalsController < ApplicationController |
|
|
|
|
|
|
|
def update |
|
|
|
content = params[:content] |
|
|
|
if content.present? |
|
|
|
if content.present? |
|
|
|
Journals::UpdateForm.new({notes: notes.to_s.strip}).validate! |
|
|
|
if @journal.update_attribute(:notes, content) |
|
|
|
normal_status(0, "更新成功") |
|
|
|
else |
|
|
|
@@ -79,7 +84,9 @@ class JournalsController < ApplicationController |
|
|
|
else |
|
|
|
normal_status(-1, "评论的内容不能为空") |
|
|
|
end |
|
|
|
|
|
|
|
rescue Exception => exception |
|
|
|
puts exception.message |
|
|
|
normal_status(-1, exception.message) |
|
|
|
end |
|
|
|
|
|
|
|
def get_children_journals |
|
|
|
|