Skip to content

armgit / spree

Public Imported from GitHub
0

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.

Allow Spree classes to specify which relationships should be included in webhook (#12084)

Damian Kaczmarczykacc5de861548
diff --git a/api/app/models/concerns/spree/webhooks/has_webhooks.rb b/api/app/models/concerns/spree/webhooks/has_webhooks.rb
index 4502d86193..75eeebc092 100644
--- a/api/app/models/concerns/spree/webhooks/has_webhooks.rb
+++ b/api/app/models/concerns/spree/webhooks/has_webhooks.rb
@@ -43,7 +43,9 @@ module Spree
end
def included_relationships
- if resource_serializer.relationships_to_serialize
+ if self.class.respond_to?(:webhook_included_relationships)
+ self.class.webhook_included_relationships
+ elsif resource_serializer.relationships_to_serialize
resource_serializer.relationships_to_serialize.keys
else
[]