summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-06-13 22:37:41 +0200
committerJasper Maes <jaspermaes.jm@gmail.com>2018-06-13 23:49:44 +0200
commit876d43b9f5ba54b4f572f4b28ea55cef82cc74ea (patch)
treec24fa75cb2f5a38f8ef521adb6ce905f6811aa02 /lib/api/helpers.rb
parent7cf571e95550b3c14eb971ea165a8930b809e1d7 (diff)
downloadgitlab-ce-876d43b9f5ba54b4f572f4b28ea55cef82cc74ea.tar.gz
Rails5 fix no implicit conversion of Hash into String. ActionController::Parameters no longer returns an hash in Rails 5
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 2ed331d4fd2..9c53b7c3fe7 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -272,7 +272,8 @@ module API
attrs[key] = params_hash[key]
end
end
- ActionController::Parameters.new(attrs).permit!
+ permitted_attrs = ActionController::Parameters.new(attrs).permit!
+ Gitlab.rails5? ? permitted_attrs.to_h : permitted_attrs
end
def filter_by_iid(items, iid)