Skip to content
Snippets Groups Projects
Commit b7dfe2ae authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 25cb337c
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 0 deletions
Loading
Loading
@@ -9,3 +9,5 @@ class Identity < ApplicationRecord
end
end
end
Identity::UniquenessScopes.prepend_if_ee('EE::Identity::UniquenessScopes')
Loading
Loading
@@ -27,6 +27,7 @@ class Issue < ApplicationRecord
 
belongs_to :project
belongs_to :moved_to, class_name: 'Issue'
belongs_to :duplicated_to, class_name: 'Issue'
belongs_to :closed_by, class_name: 'User'
 
has_internal_id :iid, scope: :project, init: ->(s) { s&.project&.issues&.maximum(:iid) }
Loading
Loading
@@ -181,6 +182,10 @@ class Issue < ApplicationRecord
!moved_to_id.nil?
end
 
def duplicated?
!duplicated_to_id.nil?
end
def can_move?(user, to_project = nil)
if to_project
return false unless user.can?(:admin_issue, to_project)
Loading
Loading
@@ -293,3 +298,5 @@ class Issue < ApplicationRecord
Gitlab::EtagCaching::Store.new.touch(key)
end
end
Issue.prepend_if_ee('EE::Issue')
Loading
Loading
@@ -4,3 +4,5 @@ class IssueAssignee < ApplicationRecord
belongs_to :issue
belongs_to :assignee, class_name: "User", foreign_key: :user_id
end
IssueAssignee.prepend_if_ee('EE::IssueAssignee')
Loading
Loading
@@ -140,3 +140,5 @@ class Key < ApplicationRecord
"type is forbidden. Must be #{allowed_types}"
end
end
Key.prepend_if_ee('EE::Key')
Loading
Loading
@@ -272,3 +272,5 @@ class Label < ApplicationRecord
%w(color title).each { |attr| self[attr] = self[attr]&.strip }
end
end
Label.prepend_if_ee('EE::Label')
Loading
Loading
@@ -103,3 +103,5 @@ class LabelNote < Note
events.select { |e| e.action == action }.map(&field)
end
end
LabelNote.prepend_if_ee('EE::LabelNote')
Loading
Loading
@@ -111,3 +111,5 @@ class LegacyDiffNote < Note
diffs.find { |d| d.new_path == self.diff.new_path }
end
end
LegacyDiffNote.prepend_if_ee('EE::LegacyDiffNote')
Loading
Loading
@@ -42,3 +42,5 @@ class LfsObject < ApplicationRecord
Digest::SHA256.file(path).hexdigest
end
end
LfsObject.prepend_if_ee('EE::LfsObject')
Loading
Loading
@@ -3,6 +3,8 @@
class List < ApplicationRecord
include Importable
 
prepend_if_ee('::EE::List') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :board
belongs_to :label
has_many :list_user_preferences
Loading
Loading
Loading
Loading
@@ -459,3 +459,5 @@ class Member < ApplicationRecord
end
end
end
Member.prepend_if_ee('EE::Member')
Loading
Loading
@@ -76,3 +76,5 @@ class GroupMember < Member
super
end
end
GroupMember.prepend_if_ee('EE::GroupMember')
Loading
Loading
@@ -146,3 +146,5 @@ class ProjectMember < Member
end
# rubocop: enable CodeReuse/ServiceClass
end
ProjectMember.prepend_if_ee('EE::ProjectMember')
# frozen_string_literal: true
 
class MembersPreloader
prepend_if_ee('EE::MembersPreloader') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :members
 
def initialize(members)
Loading
Loading
Loading
Loading
@@ -23,6 +23,8 @@ class MergeRequest < ApplicationRecord
 
SORTING_PREFERENCE_FIELD = :merge_requests_sort
 
prepend_if_ee('::EE::MergeRequest') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project"
belongs_to :merge_user, class_name: "User"
Loading
Loading
Loading
Loading
@@ -19,6 +19,8 @@ class Milestone < ApplicationRecord
include FromUnion
include Gitlab::SQL::Pattern
 
prepend_if_ee('::EE::Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description
 
Loading
Loading
Loading
Loading
@@ -354,3 +354,5 @@ class Namespace < ApplicationRecord
end
end
end
Namespace.prepend_if_ee('EE::Namespace')
Loading
Loading
@@ -520,3 +520,5 @@ class Note < ApplicationRecord
system_note_metadata&.cross_reference_types&.include?(system_note_metadata&.action)
end
end
Note.prepend_if_ee('EE::Note')
Loading
Loading
@@ -80,3 +80,5 @@ class NotificationSetting < ApplicationRecord
respond_to?(event) && !!public_send(event) # rubocop:disable GitlabSecurity/PublicSend
end
end
NotificationSetting.prepend_if_ee('EE::NotificationSetting')
Loading
Loading
@@ -114,3 +114,5 @@ class PoolRepository < ApplicationRecord
.new(self, prefix: Storage::HashedProject::POOL_PATH_PREFIX)
end
end
PoolRepository.prepend_if_ee('EE::PoolRepository')
Loading
Loading
@@ -2331,3 +2331,5 @@ class Project < ApplicationRecord
@services_templates ||= Service.where(template: true)
end
end
Project.prepend_if_ee('EE::Project')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment