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