From b3e7f9a07e09783f3dbbb89552a6d80401b53353 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 27 Dec 2019 23:05:19 +0100 Subject: [PATCH] Fix deprecated arguments used in #sanitize Failure/Error: d = sanitize(object.description, tags: "p, b, strong, em, i, a, u", attributes: "href, target") ArgumentError: You should pass :tags as an Enumerable # ./app/serializers/api/product_serializer.rb:26:in `description_html' # (eval):10:in `_fast_attributes' # ./app/services/products_renderer.rb:24:in `products_json' # ./app/controllers/api/order_cycles_controller.rb:14:in `products' # ./lib/open_food_network/rack_request_blocker.rb:36:in `call' --- app/serializers/api/product_serializer.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/serializers/api/product_serializer.rb b/app/serializers/api/product_serializer.rb index 592b67ecdb..733904c5b6 100644 --- a/app/serializers/api/product_serializer.rb +++ b/app/serializers/api/product_serializer.rb @@ -1,4 +1,4 @@ -require 'open_food_network/scope_variant_to_hub' +require "open_food_network/scope_variant_to_hub" class Api::ProductSerializer < ActiveModel::Serializer include ActionView::Helpers::SanitizeHelper @@ -23,7 +23,8 @@ class Api::ProductSerializer < ActiveModel::Serializer # return a sanitized html description def description_html - d = sanitize(object.description, tags: "p, b, strong, em, i, a, u", attributes: "href, target") + d = sanitize(object.description, tags: ["p", "b", "strong", "em", "i", "a", "u"], + attributes: ["href", "target"]) d.to_s.html_safe end