summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-09-20 11:00:06 +0200
committerJames Lopez <james@jameslopez.es>2017-09-28 08:46:39 +0200
commit9621dd0c9d31508bdac2e2e226537302b560ef10 (patch)
treef4e76be89a6cb1a85b04e87cdf33bb408f2bf63f /app/models/user.rb
parent11c8b8bc3c2294ef2e3a33196619f6e61f1e8d82 (diff)
downloadgitlab-ce-9621dd0c9d31508bdac2e2e226537302b560ef10.tar.gz
refactor services to match EE signature
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 09c9b3250eb..e9a3aea44c4 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -60,7 +60,7 @@ class User < ActiveRecord::Base
lease = Gitlab::ExclusiveLease.new("user_update_tracked_fields:#{id}", timeout: 1.hour.to_i)
return unless lease.try_obtain
- Users::UpdateService.new(self).execute(validate: false)
+ Users::UpdateService.new(self, self).execute(validate: false)
end
attr_accessor :force_random_password
@@ -526,8 +526,8 @@ class User < ActiveRecord::Base
def update_emails_with_primary_email
primary_email_record = emails.find_by(email: email)
if primary_email_record
- Emails::DestroyService.new(self, email: email).execute
- Emails::CreateService.new(self, email: email_was).execute
+ Emails::DestroyService.new(self, self, email: email).execute
+ Emails::CreateService.new(self, self, email: email_was).execute
end
end
@@ -1000,7 +1000,7 @@ class User < ActiveRecord::Base
if attempts_exceeded?
lock_access! unless access_locked?
else
- Users::UpdateService.new(self).execute(validate: false)
+ Users::UpdateService.new(self, self).execute(validate: false)
end
end
@@ -1186,7 +1186,7 @@ class User < ActiveRecord::Base
&creation_block
)
- Users::UpdateService.new(user).execute(validate: false)
+ Users::UpdateService.new(user, user).execute(validate: false)
user
ensure
Gitlab::ExclusiveLease.cancel(lease_key, uuid)