Add ofn:image to SuppliedProduct

Temporary solution as we wait for the DFC connector to be updated
to support "dfc_b:image" for SuppliedProduct
This commit is contained in:
Gaetan Craig-Riou
2023-11-03 14:44:37 +11:00
committed by David Cook
parent 9172c87fce
commit 424954ec54

View File

@@ -3,15 +3,21 @@
module DfcProvider
class SuppliedProduct < DataFoodConsortium::Connector::SuppliedProduct
attr_accessor :spree_product_id
attr_accessor :image
def initialize(semantic_id, spree_product_id: nil, **properties)
def initialize(semantic_id, spree_product_id: nil, image_url: nil, **properties)
super(semantic_id, **properties)
self.spree_product_id = spree_product_id
self.image = image_url
registerSemanticProperty("ofn:spree_product_id") do
self.spree_product_id
end
# Temporary solution, will be replaced by "dfc_b:image" in future version of the DFC connector
registerSemanticProperty("ofn:image") do
self.image
end
end
end
end