discourse_subscription_client 0.1.0.pre8 → 0.1.0.pre10
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: 7be1c54ac40f2c0221c35038e20c1daa1fac8f39c0736d11a858f805a6220791
|
4
|
+
data.tar.gz: d8a564f4d2c9bc8ef052a47719c42dcc36df45ba42d8848d32fd6a8d03b0c8cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f401dbabaa835f14619e4aa3263cee2df00048ae43c8fabd9fdae16e5c99806b6caf09896d4470c32923be77fe0a6b73d0efcd97589394d601647e3614e18d6a
|
7
|
+
data.tar.gz: 0f10faf5cd3ed514bee5ef10555846c3c66f278e3adc8360a04d4ce8e5f56a12122aa86ed763b8c1988ca4815b39432d06219a1f981f4b0919244d387c4091e5
|
@@ -24,8 +24,12 @@ class SubscriptionClientSupplier < ActiveRecord::Base
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def product_slugs
|
27
|
-
|
28
|
-
|
27
|
+
if products.present?
|
28
|
+
products.each_with_object({}) do |product, result|
|
29
|
+
result[product["product_id"]] = product["product_slug"]
|
30
|
+
end
|
31
|
+
else
|
32
|
+
{}
|
29
33
|
end
|
30
34
|
end
|
31
35
|
|
@@ -95,6 +95,7 @@ module DiscourseSubscriptionClient
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def valid_supplier_data?(data)
|
98
|
+
return false unless data.present? && data.is_a?(Hash)
|
98
99
|
return false unless %i[supplier products].all? { |key| data.key?(key) }
|
99
100
|
return false unless data[:supplier].is_a?(String)
|
100
101
|
return false unless data[:products].is_a?(Array)
|