BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
identity.rb
app/models/identity.rb
+6
-2
No files found.
app/models/identity.rb
View file @
d14851f9
class
Identity
<
ActiveRecord
::
Base
def
self
.
uniqueness_scope
:provider
end
include
Sortable
include
CaseSensitivity
belongs_to
:user
validates
:provider
,
presence:
true
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope:
:provider
,
case_sensitive:
false
}
validates
:user_id
,
uniqueness:
{
scope:
:provider
}
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope:
uniqueness_scope
,
case_sensitive:
false
}
validates
:user_id
,
uniqueness:
{
scope:
uniqueness_scope
}
before_save
:ensure_normalized_extern_uid
,
if: :extern_uid_changed?
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