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
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
Show 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
...
@@ -11,10 +11,12 @@ module Users
def
execute
(
validate:
true
,
&
block
)
def
execute
(
validate:
true
,
&
block
)
yield
(
@user
)
if
block_given?
yield
(
@user
)
if
block_given?
user_exists
=
@user
.
persisted?
assign_attributes
(
&
block
)
assign_attributes
(
&
block
)
if
@user
.
save
(
validate:
validate
)
if
@user
.
save
(
validate:
validate
)
notify_success
notify_success
(
user_exists
)
else
else
error
(
@user
.
errors
.
full_messages
.
uniq
.
join
(
'. '
))
error
(
@user
.
errors
.
full_messages
.
uniq
.
join
(
'. '
))
end
end
...
@@ -30,8 +32,8 @@ module Users
...
@@ -30,8 +32,8 @@ module Users
private
private
def
notify_success
def
notify_success
(
user_exists
)
notify_new_user
(
@user
,
nil
)
unless
@user
.
persisted?
notify_new_user
(
@user
,
nil
)
unless
user_exists
success
success
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