diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 12 | ||||
-rw-r--r-- | app/models/users/phone_number_validation.rb | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index d9726e76c4b..e22739f2dc8 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1386,7 +1386,7 @@ class MergeRequest < ApplicationRecord end def mergeable_discussions_state? - return true unless project.only_allow_merge_if_all_discussions_are_resolved?(inherit_group_setting: true) + return true unless only_allow_merge_if_all_discussions_are_resolved? unresolved_notes.none?(&:to_be_resolved?) end @@ -1566,8 +1566,16 @@ class MergeRequest < ApplicationRecord access.can_push_to_branch?(target_branch) end + def only_allow_merge_if_pipeline_succeeds? + project.only_allow_merge_if_pipeline_succeeds?(inherit_group_setting: true) + end + + def only_allow_merge_if_all_discussions_are_resolved? + project.only_allow_merge_if_all_discussions_are_resolved?(inherit_group_setting: true) + end + def mergeable_ci_state? - return true unless project.only_allow_merge_if_pipeline_succeeds?(inherit_group_setting: true) + return true unless only_allow_merge_if_pipeline_succeeds? return false unless actual_head_pipeline return true if project.allow_merge_on_skipped_pipeline?(inherit_group_setting: true) && actual_head_pipeline.skipped? diff --git a/app/models/users/phone_number_validation.rb b/app/models/users/phone_number_validation.rb index e033445d76b..27f13845102 100644 --- a/app/models/users/phone_number_validation.rb +++ b/app/models/users/phone_number_validation.rb @@ -33,6 +33,7 @@ module Users validates :telesign_reference_xid, length: { maximum: 255 } scope :for_user, -> (user_id) { where(user_id: user_id) } + scope :by_reference_id, ->(reference_id) { find_by(telesign_reference_xid: reference_id) } def self.related_to_banned_user?(international_dial_code, phone_number) joins(:banned_user).where( |