summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/has_repository.rb1
-rw-r--r--app/models/project.rb1
-rw-r--r--app/models/user.rb3
3 files changed, 2 insertions, 3 deletions
diff --git a/app/models/concerns/has_repository.rb b/app/models/concerns/has_repository.rb
index 01f1aa1758f..35faa87e876 100644
--- a/app/models/concerns/has_repository.rb
+++ b/app/models/concerns/has_repository.rb
@@ -11,6 +11,7 @@ module HasRepository
extend ActiveSupport::Concern
include AfterCommitQueue
include Referable
+ include Gitlab::ShellAdapter
include Gitlab::Utils::StrongMemoize
delegate :base_dir, :disk_path, to: :storage
diff --git a/app/models/project.rb b/app/models/project.rb
index cc7a732d94a..eb4412decba 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -4,7 +4,6 @@ require 'carrierwave/orm/activerecord'
class Project < ApplicationRecord
include Gitlab::ConfigHelper
- include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel
include AccessRequestable
include Avatarable
diff --git a/app/models/user.rb b/app/models/user.rb
index 62624f8eec1..68c52751804 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -109,7 +109,6 @@ class User < ApplicationRecord
# Groups
has_many :members
- has_one :max_access_level_membership, -> { select(:id, :user_id, :access_level).order(access_level: :desc).readonly }, class_name: 'Member'
has_many :group_members, -> { where(requested_at: nil) }, source: 'GroupMember'
has_many :groups, through: :group_members
has_many :owned_groups, -> { where(members: { access_level: Gitlab::Access::OWNER }) }, through: :group_members, source: :group
@@ -1080,7 +1079,7 @@ class User < ApplicationRecord
end
def highest_role
- max_access_level_membership&.access_level || Gitlab::Access::NO_ACCESS
+ user_highest_role&.highest_access_level || Gitlab::Access::NO_ACCESS
end
def accessible_deploy_keys