diff --git a/app/controllers/project_comments_controller.rb b/app/controllers/project_comments_controller.rb index 365359008..3a868d2e6 100644 --- a/app/controllers/project_comments_controller.rb +++ b/app/controllers/project_comments_controller.rb @@ -44,7 +44,7 @@ class ProjectCommentsController < ApplicationController @comment = Comment.new( message: comment_params[:message], user: current_user) - + respond_to do |format| if (@comment.valid? && @project.comments << @comment) @@ -70,7 +70,7 @@ class ProjectCommentsController < ApplicationController format.json { render json: { errors: @comment.errors.to_hash(true) - } + } } end end diff --git a/app/controllers/step_comments_controller.rb b/app/controllers/step_comments_controller.rb index bb603e69a..3acfefacb 100644 --- a/app/controllers/step_comments_controller.rb +++ b/app/controllers/step_comments_controller.rb @@ -56,7 +56,7 @@ class StepCommentsController < ApplicationController Activity.create( type_of: :add_comment_to_step, user: current_user, - project: @step.my_module.project, + project: @step.my_module.experiment.project, my_module: @step.my_module, message: t( "activities.add_comment_to_step",