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.

Deprecate ProductProperty#property_name=

Damian Legawiec4f63bf0cd1ba
diff --git a/core/app/models/spree/product_property.rb b/core/app/models/spree/product_property.rb
index cb21b6c27d..a4829c4e3b 100644
--- a/core/app/models/spree/product_property.rb
+++ b/core/app/models/spree/product_property.rb
@@ -22,6 +22,9 @@ module Spree
delegate :name, :presentation, to: :property, prefix: true, allow_nil: true
def property_name=(name)
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
+ `ProductProperty#property_name=` is deprecated and will be removed in Spree 5.0.
+ DEPRECATION
if name.present?
# don't use `find_by :name` to workaround globalize/globalize#423 bug
self.property = Property.where(name: name).first_or_create(presentation: name)