mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
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
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: