From a434fc59f5304432eb57cbcaf4c3da28eb590cf9 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 15 Oct 2024 14:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E6=A0=B9=E6=8D=AEid?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2issue=20pr=E7=BC=A9=E5=B0=8F=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/issues/journals_controller.rb | 2 +- app/controllers/api/v1/issues_controller.rb | 2 +- app/controllers/mark_files_controller.rb | 2 +- app/controllers/pull_requests_controller.rb | 4 ++-- app/controllers/reviews_controller.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/v1/issues/journals_controller.rb b/app/controllers/api/v1/issues/journals_controller.rb index 4a88c1b0f..a549714ff 100644 --- a/app/controllers/api/v1/issues/journals_controller.rb +++ b/app/controllers/api/v1/issues/journals_controller.rb @@ -46,7 +46,7 @@ class Api::V1::Issues::JournalsController < Api::V1::BaseController end def load_issue - @issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || Issue.find_by_id(params[:index]) + @issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || @project.issues.issue_issue.find_by_id(params[:index]) if @issue.blank? render_not_found("疑修不存在!") end diff --git a/app/controllers/api/v1/issues_controller.rb b/app/controllers/api/v1/issues_controller.rb index 76185a16b..87b7c051e 100644 --- a/app/controllers/api/v1/issues_controller.rb +++ b/app/controllers/api/v1/issues_controller.rb @@ -70,7 +70,7 @@ class Api::V1::IssuesController < Api::V1::BaseController private def load_issue - @issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || Issue.find_by_id(params[:index]) + @issue = @project.issues.issue_issue.where(project_issues_index: params[:index]).where.not(id: params[:index]).take || @project.issues.issue_issue.find_by_id(params[:index]) if @issue.blank? render_not_found("疑修不存在!") end diff --git a/app/controllers/mark_files_controller.rb b/app/controllers/mark_files_controller.rb index a7ec304fd..f21b759fb 100644 --- a/app/controllers/mark_files_controller.rb +++ b/app/controllers/mark_files_controller.rb @@ -50,7 +50,7 @@ class MarkFilesController < ApplicationController end def load_pull_request - @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id]) + @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id]) end end \ No newline at end of file diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 1fe079f29..dd10ddad1 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -295,11 +295,11 @@ class PullRequestsController < ApplicationController private def load_pull_request - @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id]) + @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id]) end def find_pull_request - @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id]) + @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id]) @issue = @pull_request&.issue if @pull_request.blank? normal_status(-1, "合并请求不存在") diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index b5fedfae0..8ad90e5f0 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -14,7 +14,7 @@ class ReviewsController < ApplicationController end def load_pull_request - @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || PullRequest.find_by_id(params[:id]) + @pull_request = @project.pull_requests.where(gitea_number: params[:id]).where.not(id: params[:id]).take || @project.pull_requests.find_by_id(params[:id]) end end \ No newline at end of file