Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5bcac954
Commit
5bcac954
authored
Apr 02, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove has_many :source usages
(cherry picked from commit 016c9a30e1ea484bf7c17341b2260b4f00c5931a)
parent
4fa2c3c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/user.rb
app/models/user.rb
+2
-2
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+2
-2
No files found.
app/models/user.rb
View file @
5bcac954
...
...
@@ -127,7 +127,7 @@ class User < ApplicationRecord
# Groups
has_many
:members
has_many
:group_members
,
->
{
where
(
requested_at:
nil
).
where
(
"access_level >= ?"
,
Gitlab
::
Access
::
GUEST
)
},
sourc
e:
'GroupMember'
has_many
:group_members
,
->
{
where
(
requested_at:
nil
).
where
(
"access_level >= ?"
,
Gitlab
::
Access
::
GUEST
)
},
class_nam
e:
'GroupMember'
has_many
:groups
,
through: :group_members
has_many
:owned_groups
,
->
{
where
(
members:
{
access_level:
Gitlab
::
Access
::
OWNER
})
},
through: :group_members
,
source: :group
has_many
:maintainers_groups
,
->
{
where
(
members:
{
access_level:
Gitlab
::
Access
::
MAINTAINER
})
},
through: :group_members
,
source: :group
...
...
@@ -141,7 +141,7 @@ class User < ApplicationRecord
->
{
where
(
members:
{
access_level:
[
Gitlab
::
Access
::
REPORTER
,
Gitlab
::
Access
::
DEVELOPER
,
Gitlab
::
Access
::
MAINTAINER
,
Gitlab
::
Access
::
OWNER
]
})
},
through: :group_members
,
source: :group
has_many
:minimal_access_group_members
,
->
{
where
(
access_level:
[
Gitlab
::
Access
::
MINIMAL_ACCESS
])
},
source:
'GroupMember'
,
class_name:
'GroupMember'
has_many
:minimal_access_group_members
,
->
{
where
(
access_level:
[
Gitlab
::
Access
::
MINIMAL_ACCESS
])
},
class_name:
'GroupMember'
has_many
:minimal_access_groups
,
through: :minimal_access_group_members
,
source: :group
# Projects
...
...
ee/app/models/ee/user.rb
View file @
5bcac954
...
...
@@ -49,7 +49,7 @@ module EE
has_many
:approvals
,
dependent: :destroy
# rubocop: disable Cop/ActiveRecordDependent
has_many
:approvers
,
dependent: :destroy
# rubocop: disable Cop/ActiveRecordDependent
has_many
:minimal_access_group_members
,
->
{
where
(
access_level:
[
::
Gitlab
::
Access
::
MINIMAL_ACCESS
])
},
source:
'GroupMember'
,
class_name:
'GroupMember'
has_many
:minimal_access_group_members
,
->
{
where
(
access_level:
[
::
Gitlab
::
Access
::
MINIMAL_ACCESS
])
},
class_name:
'GroupMember'
has_many
:minimal_access_groups
,
through: :minimal_access_group_members
,
source: :group
has_many
:users_ops_dashboard_projects
...
...
@@ -57,7 +57,7 @@ module EE
has_many
:users_security_dashboard_projects
has_many
:security_dashboard_projects
,
through: :users_security_dashboard_projects
,
source: :project
has_many
:group_saml_identities
,
->
{
where
.
not
(
saml_provider_id:
nil
)
},
source: :identities
,
class_name:
"::Identity"
has_many
:group_saml_identities
,
->
{
where
.
not
(
saml_provider_id:
nil
)
},
class_name:
"::Identity"
# Protected Branch Access
has_many
:protected_branch_merge_access_levels
,
dependent: :destroy
,
class_name:
"::ProtectedBranch::MergeAccessLevel"
# rubocop:disable Cop/ActiveRecordDependent
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment