diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-21 17:44:24 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-21 18:47:55 +0100 |
commit | 039d4a1cbff5b54dc60363ff5f244e84cb54aacf (patch) | |
tree | 66c58bc0e9ec3b766fbdcdcf7bf1e27c7f560581 /lib/api | |
parent | 80eaed1651e6a278af87e015f6b414d4f943a352 (diff) | |
download | gitlab-ce-039d4a1cbff5b54dc60363ff5f244e84cb54aacf.tar.gz |
Fix StrongAttibutes error with Ruby 2.124730-broken-master
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/users.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index c07539194ed..a73650dc361 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -140,7 +140,8 @@ module API User.where(username: params[:username]). 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? identity = user.identities.find_by(provider: identity_attrs[:provider]) @@ -154,10 +155,10 @@ module API end # Delete already handled parameters - params.delete(:extern_uid) - params.delete(:provider) + user_params.delete(:extern_uid) + user_params.delete(:provider) - if user.update_attributes(declared_params(include_missing: false)) + if user.update_attributes(user_params) present user, with: Entities::UserFull else render_validation_error!(user) |