Rails5 fix no implicit conversion of Hash into String. ActionController::Parameters no longer returns an hash in Rails 5

This commit is contained in:
Jasper Maes 2018-06-13 22:37:41 +02:00
parent 7cf571e955
commit 876d43b9f5
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,6 @@
---
title: Rails5 fix no implicit conversion of Hash into String. ActionController::Parameters
no longer returns an hash in Rails 5
merge_request: 19792
author: Jasper Maes
type: fixed

View file

@ -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)