summaryrefslogtreecommitdiff
path: root/app/controllers/projects/issues_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/issues_controller.rb')
-rw-r--r--app/controllers/projects/issues_controller.rb33
1 files changed, 16 insertions, 17 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index b9d02a62fc3..6d25ec310f7 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -49,11 +49,11 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.html
- format.atom { render layout: 'xml.atom' }
+ format.atom { render layout: "xml.atom" }
format.json do
render json: {
html: view_to_html_string("projects/issues/_issues"),
- labels: @labels.as_json(methods: :text_color)
+ labels: @labels.as_json(methods: :text_color),
}
end
end
@@ -95,10 +95,10 @@ class Projects::IssuesController < Projects::ApplicationController
if service.discussions_to_resolve.count(&:resolved?) > 0
flash[:notice] = if service.discussion_to_resolve_id
- "Resolved 1 discussion."
- else
- "Resolved all discussions."
- end
+ "Resolved 1 discussion."
+ else
+ "Resolved all discussions."
+ end
end
respond_to do |format|
@@ -126,7 +126,6 @@ class Projects::IssuesController < Projects::ApplicationController
render_issue_json
end
end
-
rescue ActiveRecord::StaleObjectError
render_conflict_response
end
@@ -137,7 +136,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.json do
render json: {
- html: view_to_html_string('projects/issues/_merge_requests')
+ html: view_to_html_string("projects/issues/_merge_requests"),
}
end
end
@@ -149,7 +148,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.json do
render json: {
- html: view_to_html_string('projects/issues/_related_branches')
+ html: view_to_html_string("projects/issues/_related_branches"),
}
end
end
@@ -162,7 +161,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.json do
- render json: { can_create_branch: can_create, suggested_branch_name: @issue.suggested_branch_name }
+ render json: {can_create_branch: can_create, suggested_branch_name: @issue.suggested_branch_name}
end
end
end
@@ -209,10 +208,10 @@ class Projects::IssuesController < Projects::ApplicationController
@issue
end
# rubocop: enable CodeReuse/ActiveRecord
- alias_method :subscribable_resource, :issue
- alias_method :issuable, :issue
- alias_method :awardable, :issue
- alias_method :spammable, :issue
+ alias subscribable_resource issue
+ alias issuable issue
+ alias awardable issue
+ alias spammable issue
def spammable_path
project_issue_path(@project, @issue)
@@ -226,7 +225,7 @@ class Projects::IssuesController < Projects::ApplicationController
if @issue.valid?
render json: serializer.represent(@issue)
else
- render json: { errors: @issue.errors.full_messages }, status: :unprocessable_entity
+ render json: {errors: @issue.errors.full_messages}, status: :unprocessable_entity
end
end
@@ -247,7 +246,7 @@ class Projects::IssuesController < Projects::ApplicationController
task_num
lock_version
discussion_locked
- ] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }]
+ ] + [{label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source]}]
end
def store_uri
@@ -275,7 +274,7 @@ class Projects::IssuesController < Projects::ApplicationController
# 1. https://gitlab.com/gitlab-org/gitlab-ce/issues/42423
# 2. https://gitlab.com/gitlab-org/gitlab-ce/issues/42424
# 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426
- Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42422')
+ Gitlab::QueryLimiting.whitelist("https://gitlab.com/gitlab-org/gitlab-ce/issues/42422")
end
def set_suggested_issues_feature_flags