Add a comment around the use of safe_constantize

It triggers a Brakeman error that can be safely ignored
This commit is contained in:
Gaetan Craig-Riou
2023-07-24 11:39:26 +10:00
parent 9c9a6234e1
commit a2def2424c

View File

@@ -9,6 +9,8 @@ module Admin
end
def create
# The use of "safe_constantize" here will trigger a Brakeman error, it can safely be ignored
# as it's a false positive : https://github.com/openfoodfoundation/openfoodnetwork/pull/10821
voucher_type = params[:vouchers_flat_rate][:voucher_type]
if Voucher::TYPES.include?(voucher_type)
@voucher = voucher_type.safe_constantize.create(