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
505cbc11
Commit
505cbc11
authored
Sep 23, 2021
by
Alejandro Guerrero
Committed by
alejguer
Sep 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include StripAttribute
parent
83b577be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
ee/app/models/saml_group_link.rb
ee/app/models/saml_group_link.rb
+2
-4
No files found.
ee/app/models/saml_group_link.rb
View file @
505cbc11
# frozen_string_literal: true
# frozen_string_literal: true
class
SamlGroupLink
<
ApplicationRecord
class
SamlGroupLink
<
ApplicationRecord
include
StripAttribute
belongs_to
:group
belongs_to
:group
enum
access_level:
::
Gitlab
::
Access
.
options_with_owner
enum
access_level:
::
Gitlab
::
Access
.
options_with_owner
before_validation
:strip_whitespace_from_
saml_group_name
strip_attributes!
:
saml_group_name
validates
:group
,
:access_level
,
presence:
true
validates
:group
,
:access_level
,
presence:
true
validates
:saml_group_name
,
presence:
true
,
uniqueness:
{
scope:
[
:group_id
]
},
length:
{
maximum:
255
}
validates
:saml_group_name
,
presence:
true
,
uniqueness:
{
scope:
[
:group_id
]
},
length:
{
maximum:
255
}
...
@@ -15,8 +16,5 @@ class SamlGroupLink < ApplicationRecord
...
@@ -15,8 +16,5 @@ class SamlGroupLink < ApplicationRecord
scope
:by_group_id
,
->
(
group_id
)
{
where
(
group_id:
group_id
)
}
scope
:by_group_id
,
->
(
group_id
)
{
where
(
group_id:
group_id
)
}
scope
:preload_group
,
->
{
preload
(
group: :route
)
}
scope
:preload_group
,
->
{
preload
(
group: :route
)
}
def
strip_whitespace_from_saml_group_name
self
.
saml_group_name
=
self
&
.
saml_group_name
.
strip
end
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