1 class IssueCommentsController < ApplicationController
4 before_action :authorize_web
5 before_action :set_locale
10 @issue = Issue.find(params[:issue_id])
11 comment = @issue.comments.build(issue_comment_params)
12 comment.user = current_user
14 notice = t(".comment_created")
15 reassign_issue(@issue) if params[:reassign]
16 redirect_to @issue, :notice => notice
21 def issue_comment_params
22 params.require(:issue_comment).permit(:body)
25 def deny_access(_exception)
27 flash[:error] = t("application.require_moderator_or_admin.not_a_moderator_or_admin")
34 # This sort of assumes there are only two roles
35 def reassign_issue(issue)
36 role = (Issue::ASSIGNED_ROLES - [issue.assigned_role]).first
37 issue.assigned_role = role