e_plat 1.1.0.pre.rc.7 → 1.1.0.pre.rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46fbc594c104c4beedff0ba465d323dee4dc3dec07487506d697f74b2f5cf93c
|
4
|
+
data.tar.gz: e76bfe7bc0033f416833c720d759467dc02fb16e49b69c10c092e19f23ef9f63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af5a27b232c51e295b8e7fa4ff1b7ddaa29b5671e412ca3847a851c28b347b9ed1807d323419619185b6ae42a030a442525d927f71da3cd8027faef9e79f9620
|
7
|
+
data.tar.gz: 6a3f66b61023373ec10546ad49ab452c349afca9e58034d0625299d3620f94605ba3c591d6db0ade2468a4f7fc35139db7562634167919c94733851e18eb2418
|
@@ -20,12 +20,14 @@ module EPlat::Woocommerce
|
|
20
20
|
def initialize(attributes = {}, persisted = false)
|
21
21
|
super
|
22
22
|
|
23
|
-
# Ensure option_values have stable IDs based on name
|
23
|
+
# Ensure option_values have stable IDs based on name and option value combined
|
24
24
|
if self.option_values.present?
|
25
25
|
self.option_values.each do |option_value|
|
26
26
|
if (option_value.attributes["id"].nil? || option_value.attributes["id"] == 0) && option_value.name.present?
|
27
|
-
#
|
28
|
-
|
27
|
+
# Generate a unique ID based on both name and option value
|
28
|
+
# This ensures options with the same name but different values get different IDs
|
29
|
+
name_option_key = "#{option_value.name}_#{option_value.option}"
|
30
|
+
option_value.attributes["id"] = string_to_consistent_id(name_option_key)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
data/lib/e_plat/version.rb
CHANGED