Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Add support for Cloudinary CDN (#11615)
Damian Legawiecad277a6c6e56
diff --git a/core/config/routes.rb b/core/config/routes.rbindex 88881a63b9..cdc79a307b 100644--- a/core/config/routes.rb+++ b/core/config/routes.rb@@ -2,7 +2,17 @@# see: https://github.com/rails/rails/issues/34872Rails.application.routes.draw dodirect :cdn_image do |model, options|- if model.respond_to?(:signed_id)+ if model.blob.service_name == 'cloudinary' && defined?(Cloudinary)+ if model.class.method_defined?(:has_mvariation)+ Cloudinary::Utils.cloudinary_url(model.blob.key,+ width: model.variation.transformations[:resize_to_limit].first,+ height: model.variation.transformations[:resize_to_limit].last,+ crop: :fill+ )+ else+ Cloudinary::Utils.cloudinary_url(model.blob.key)+ end+ elsif model.respond_to?(:signed_id)route_for(:rails_service_blob_proxy,model.signed_id,