mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
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'
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user