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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
d14851f9
Commit
d14851f9
authored
Apr 22, 2018
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport Identity.uniqueness_scope from EE
Originates in 'SamlProvider has many linked Identities' from EE
parent
b51f6e2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
app/models/identity.rb
app/models/identity.rb
+6
-2
No files found.
app/models/identity.rb
View file @
d14851f9
class
Identity
<
ActiveRecord
::
Base
class
Identity
<
ActiveRecord
::
Base
def
self
.
uniqueness_scope
:provider
end
include
Sortable
include
Sortable
include
CaseSensitivity
include
CaseSensitivity
belongs_to
:user
belongs_to
:user
validates
:provider
,
presence:
true
validates
:provider
,
presence:
true
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope:
:provider
,
case_sensitive:
false
}
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope:
uniqueness_scope
,
case_sensitive:
false
}
validates
:user_id
,
uniqueness:
{
scope:
:provider
}
validates
:user_id
,
uniqueness:
{
scope:
uniqueness_scope
}
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?
...
...
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