Commit 039d4a1c authored by Rémy Coutable's avatar Rémy Coutable

Fix StrongAttibutes error with Ruby 2.1

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 80eaed16
...@@ -140,7 +140,8 @@ module API ...@@ -140,7 +140,8 @@ module API
User.where(username: params[:username]). User.where(username: params[:username]).
where.not(id: user.id).count > 0 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? if identity_attrs.any?
identity = user.identities.find_by(provider: identity_attrs[:provider]) identity = user.identities.find_by(provider: identity_attrs[:provider])
...@@ -154,10 +155,10 @@ module API ...@@ -154,10 +155,10 @@ module API
end end
# Delete already handled parameters # Delete already handled parameters
params.delete(:extern_uid) user_params.delete(:extern_uid)
params.delete(:provider) user_params.delete(:provider)
if user.update_attributes(declared_params(include_missing: false)) if user.update_attributes(user_params)
present user, with: Entities::UserFull present user, with: Entities::UserFull
else else
render_validation_error!(user) 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