From 424954ec54f74721e3d2c912de48523fae2eba90 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Fri, 3 Nov 2023 14:44:37 +1100 Subject: [PATCH] Add ofn:image to SuppliedProduct Temporary solution as we wait for the DFC connector to be updated to support "dfc_b:image" for SuppliedProduct --- engines/dfc_provider/lib/dfc_provider/supplied_product.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/dfc_provider/lib/dfc_provider/supplied_product.rb b/engines/dfc_provider/lib/dfc_provider/supplied_product.rb index 06b762ba87..dcaf35d9b5 100644 --- a/engines/dfc_provider/lib/dfc_provider/supplied_product.rb +++ b/engines/dfc_provider/lib/dfc_provider/supplied_product.rb @@ -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