Skip to content

Commit

Permalink
Add a comment around the use of safe_constantize
Browse files Browse the repository at this point in the history
It triggers a Brakeman error that can be safely ignored
  • Loading branch information
rioug committed Aug 11, 2023
1 parent e9aa1da commit 7a563cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/admin/vouchers_controller.rb
Expand Up @@ -9,6 +9,8 @@ def new
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(
Expand Down

0 comments on commit 7a563cd

Please sign in to comment.