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
13f97e72
Commit
13f97e72
authored
Nov 21, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix StrongAttibutes error with Ruby 2.1
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
fb98b915
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lib/api/users.rb
lib/api/users.rb
+5
-4
No files found.
lib/api/users.rb
View file @
13f97e72
...
@@ -142,7 +142,8 @@ module API
...
@@ -142,7 +142,8 @@ module API
User
.
where
(
username:
params
[
:username
]).
User
.
where
(
username:
params
[
:username
]).
where
.
not
(
id:
user
.
id
).
count
>
0
where
.
not
(
id:
user
.
id
).
count
>
0
identity_attrs
=
params
.
slice
(
:provider
,
:extern_uid
)
user_params
=
declared_params
(
include_missing:
false
)
identity_attrs
=
user_params
.
slice
(
:provider
,
:extern_uid
)
if
identity_attrs
.
any?
if
identity_attrs
.
any?
identity
=
user
.
identities
.
find_by
(
provider:
identity_attrs
[
:provider
])
identity
=
user
.
identities
.
find_by
(
provider:
identity_attrs
[
:provider
])
...
@@ -156,10 +157,10 @@ module API
...
@@ -156,10 +157,10 @@ module API
end
end
# Delete already handled parameters
# Delete already handled parameters
params
.
delete
(
:extern_uid
)
user_
params
.
delete
(
:extern_uid
)
params
.
delete
(
:provider
)
user_
params
.
delete
(
:provider
)
if
user
.
update_attributes
(
declared_params
(
include_missing:
false
)
)
if
user
.
update_attributes
(
user_params
)
present
user
,
with:
Entities
::
UserFull
present
user
,
with:
Entities
::
UserFull
else
else
render_validation_error!
(
user
)
render_validation_error!
(
user
)
...
...
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