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
Jérome Perrin
gitlab-ce
Commits
faa95ba4
Commit
faa95ba4
authored
Sep 20, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix users update service
parent
7188975c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
app/services/users/update_service.rb
app/services/users/update_service.rb
+5
-3
No files found.
app/services/users/update_service.rb
View file @
faa95ba4
...
...
@@ -11,10 +11,12 @@ module Users
def
execute
(
validate:
true
,
&
block
)
yield
(
@user
)
if
block_given?
user_exists
=
@user
.
persisted?
assign_attributes
(
&
block
)
if
@user
.
save
(
validate:
validate
)
notify_success
notify_success
(
user_exists
)
else
error
(
@user
.
errors
.
full_messages
.
uniq
.
join
(
'. '
))
end
...
...
@@ -30,8 +32,8 @@ module Users
private
def
notify_success
notify_new_user
(
@user
,
nil
)
unless
@user
.
persisted?
def
notify_success
(
user_exists
)
notify_new_user
(
@user
,
nil
)
unless
user_exists
success
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