mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
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:
committed by
David Cook
parent
9172c87fce
commit
424954ec54
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user