diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/models/external_pull_request.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/models/external_pull_request.rb')
-rw-r--r-- | app/models/external_pull_request.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/external_pull_request.rb b/app/models/external_pull_request.rb index 3fc166203e7..4654f7e2341 100644 --- a/app/models/external_pull_request.rb +++ b/app/models/external_pull_request.rb @@ -11,7 +11,7 @@ # When the mirror is updated and changes are pushed to branches we check # if there are open pull requests for the source and target branch. # If so, we create pipelines for external pull requests. -class ExternalPullRequest < ApplicationRecord +class ExternalPullRequest < Ci::ApplicationRecord include Gitlab::Utils::StrongMemoize include ShaAttribute @@ -40,6 +40,9 @@ class ExternalPullRequest < ApplicationRecord scope :by_source_branch, ->(branch) { where(source_branch: branch) } scope :by_source_repository, -> (repository) { where(source_repository: repository) } + # Needed to override Ci::ApplicationRecord as this does not have ci_ table prefix + self.table_name = 'external_pull_requests' + def self.create_or_update_from_params(params) find_params = params.slice(:project_id, :source_branch, :target_branch) |