Commit e1b493ea authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-master' into 'master'

Fix StrongAttibutes error with Ruby 2.1

Similarly to gitlab-org/gitlab-ce!7625

See merge request !909
parents fb98b915 13f97e72
......@@ -142,7 +142,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])
......@@ -156,10 +157,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment