Files
openfoodnetwork/engines/dfc_provider
Carlos Chitty b43fa55a7b Do not try to generate a URL for unpersisted blobs in development/test environment
Explicitly raise an error in `image_variant_url_for` if an Active Storage variant's blob is not persisted.

This addresses `ArgumentError`/`URI::InvalidURIError` in Rails 7.1, which occurs when attempting to generate a URL for an unsaved Active Storage blob. By raising, we ensure existing error handling in calling methods (e.g., `Spree::Image#url`) can provide graceful fallbacks (default image URLs).

This should only affect test and development environments where blobs may not be immediately persisted. Tests in `SuppliedProductImporter` have been updated to reflect this behavior.

References:
  - Suggestion: https://github.com/openfoodfoundation/openfoodnetwork/pull/13232#discussion_r2071116581
  - Example of failing test due to this: https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/14739687958/job/41374346184?pr=13232
  - Related: https://github.com/rails/rails/issues/50234
2025-06-27 15:05:52 -04:00
..
2025-06-17 10:50:24 +10:00
2025-06-18 11:12:01 +10:00
2024-11-29 16:16:42 +11:00
2025-02-13 10:50:41 +11:00
2023-07-03 13:25:55 +10:00

Data Food Consortium API for the Open Food Network app (OFN DFC API)

This engine implements the Data Food Consortium specifications. It serves and reads semantic data encoded in JSON-LD.

The API is documented with Swagger at /api-docs. You can update these docs with:

./script/rswag engines/dfc_provider

More documentation by the Data Food Consortium: