Additionaly removed some unneeded code, related to the previous commit.

This commit is contained in:
Matej Zrimšek 2018-03-04 15:24:43 +01:00
parent fa7710fb80
commit 61d1f5374d

View file

@ -51,7 +51,6 @@ class StepCommentsController < ApplicationController
step_comment_annotation_notification
# Generate activity (this can only occur in module,
# but nonetheless check if my module is not nil)
if @protocol.in_module?
Activity.create(
type_of: :add_comment_to_step,
user: current_user,
@ -65,7 +64,6 @@ class StepCommentsController < ApplicationController
step_name: @step.name
)
)
end
format.json {
render json: {
@ -112,7 +110,6 @@ class StepCommentsController < ApplicationController
step_comment_annotation_notification(old_text)
# Generate activity
if @protocol.in_module?
Activity.create(
type_of: :edit_step_comment,
user: current_user,
@ -126,7 +123,6 @@ class StepCommentsController < ApplicationController
step_name: @step.name
)
)
end
message = custom_auto_link(@comment.message)
render json: { comment: message }, status: :ok
else
@ -142,7 +138,6 @@ class StepCommentsController < ApplicationController
format.json do
if @comment.destroy
# Generate activity
if @protocol.in_module?
Activity.create(
type_of: :delete_step_comment,
user: current_user,
@ -156,7 +151,6 @@ class StepCommentsController < ApplicationController
step_name: @step.name
)
)
end
render json: {}, status: :ok
else
render json: { message: I18n.t('comments.delete_error') },