mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Explicitely load our DFC Connector patches
It makes sure we can extend functionality without conflicts.
This commit is contained in:
@@ -43,7 +43,7 @@ module DfcProvider
|
||||
private
|
||||
|
||||
def import
|
||||
DfcLoader.connector.import(request.body)
|
||||
DfcIo.import(request.body)
|
||||
end
|
||||
|
||||
def variant
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Load our monkey-patches:
|
||||
require "data_food_consortium/connector/connector"
|
||||
|
||||
# Our interface to the DFC Connector library.
|
||||
module DfcIo
|
||||
# Serialise DFC Connector subjects as JSON-LD string.
|
||||
@@ -8,4 +11,8 @@ module DfcIo
|
||||
|
||||
DfcLoader.connector.export(*subjects)
|
||||
end
|
||||
|
||||
def self.import(json_string_or_io)
|
||||
DfcLoader.connector.import(json_string_or_io)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "context"
|
||||
# Load the original library first:
|
||||
require "datafoodconsortium/connector"
|
||||
|
||||
# Then our tools for monky-patching:
|
||||
require_relative "importer"
|
||||
require_relative "context"
|
||||
|
||||
module DataFoodConsortium
|
||||
module Connector
|
||||
|
||||
Reference in New Issue
Block a user