diff options
author | Robert Speicher <robert@gitlab.com> | 2016-11-22 05:54:24 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-11-22 05:54:24 +0000 |
commit | e76c195ebd0987b241e8c9d1b4f231ac12ba7cf8 (patch) | |
tree | 867f24d6e0860b85cfe1cb65658c62a4851dfb9d /lib | |
parent | 56b420ae10aa91807b5be2b8e4c18d67313d27dc (diff) | |
parent | 039d4a1cbff5b54dc60363ff5f244e84cb54aacf (diff) | |
download | gitlab-ce-e76c195ebd0987b241e8c9d1b4f231ac12ba7cf8.tar.gz |
Merge branch '24730-broken-master' into 'master'
Fix StrongAttibutes error with Ruby 2.1
Closes #24730
See merge request !7625
Diffstat (limited to 'lib')
-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) |