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
62b47eef
Commit
62b47eef
authored
Aug 31, 2021
by
Alejandro Guerrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip whitespace from saml_group_name
parent
895dff25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
ee/app/models/saml_group_link.rb
ee/app/models/saml_group_link.rb
+7
-0
No files found.
ee/app/models/saml_group_link.rb
View file @
62b47eef
...
...
@@ -5,6 +5,8 @@ class SamlGroupLink < ApplicationRecord
enum
access_level:
::
Gitlab
::
Access
.
options_with_owner
before_validation
:strip_whitespace_from_saml_group_name
validates
:group
,
:access_level
,
presence:
true
validates
:saml_group_name
,
presence:
true
,
uniqueness:
{
scope:
[
:group_id
]
},
length:
{
maximum:
255
}
...
...
@@ -12,4 +14,9 @@ class SamlGroupLink < ApplicationRecord
scope
:by_saml_group_name
,
->
(
name
)
{
where
(
saml_group_name:
name
)
}
scope
:by_group_id
,
->
(
group_id
)
{
where
(
group_id:
group_id
)
}
scope
:preload_group
,
->
{
preload
(
group: :route
)
}
def
strip_whitespace_from_saml_group_name
saml_group_name
.
strip!
end
end
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