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
dac520aa
Commit
dac520aa
authored
May 24, 2019
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds Identity#for_user for use in an EE MR
parent
36e15a86
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
app/models/identity.rb
app/models/identity.rb
+1
-0
No files found.
app/models/identity.rb
View file @
dac520aa
...
@@ -13,6 +13,7 @@ class Identity < ApplicationRecord
...
@@ -13,6 +13,7 @@ class Identity < ApplicationRecord
before_save
:ensure_normalized_extern_uid
,
if: :extern_uid_changed?
before_save
:ensure_normalized_extern_uid
,
if: :extern_uid_changed?
after_destroy
:clear_user_synced_attributes
,
if: :user_synced_attributes_metadata_from_provider?
after_destroy
:clear_user_synced_attributes
,
if: :user_synced_attributes_metadata_from_provider?
scope
:for_user
,
->
(
user
)
{
where
(
user:
user
)
}
scope
:with_provider
,
->
(
provider
)
{
where
(
provider:
provider
)
}
scope
:with_provider
,
->
(
provider
)
{
where
(
provider:
provider
)
}
scope
:with_extern_uid
,
->
(
provider
,
extern_uid
)
do
scope
:with_extern_uid
,
->
(
provider
,
extern_uid
)
do
iwhere
(
extern_uid:
normalize_uid
(
provider
,
extern_uid
)).
with_provider
(
provider
)
iwhere
(
extern_uid:
normalize_uid
(
provider
,
extern_uid
)).
with_provider
(
provider
)
...
...
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