zuora_connect 1.7.20 → 1.7.21
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 +4 -4
- data/app/models/zuora_connect/app_instance_base.rb +12 -6
- data/lib/zuora_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2042593e49d99996fc3e0b4bb62d1fa715321da
|
4
|
+
data.tar.gz: c55c2a56f9402c714aae9db0df016b7b6506a1b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ae6b380c40d45ffe40724abf11ac1e4a8bbc39e3028d4e882e726e44dc9df446bc622dab6c85e958be2e453642926bd7512c06d937116de1733b7b6bdeb696
|
7
|
+
data.tar.gz: 4ecbc935e1b59f17ba947c430f4f4ad84c7c9122ca0558664ce60d42311033fe72a19283346414c2f3701e8c7c0a74ea50c1d4f6b95c047656f76753dd29009b
|
@@ -556,9 +556,8 @@ module ZuoraConnect
|
|
556
556
|
# Move from tmp to actual
|
557
557
|
ActiveRecord::Base.connection.execute('UPDATE "public"."zuora_connect_app_instances" SET "catalog" = jsonb_set("catalog", \'{%{entity}}\', "catalog" #> \'{tmp}\'), "catalog_mapping" = jsonb_set("catalog_mapping", \'{%{entity}}\', "catalog_mapping" #> \'{tmp}\') where "id" = %{id}' % {:entity => entity_reference, :id => self.id})
|
558
558
|
if defined?(Redis.current)
|
559
|
-
Redis.current.
|
560
|
-
|
561
|
-
end
|
559
|
+
catalog_keys = Redis.current.smembers("Catalog:#{self.id}:Keys")
|
560
|
+
Redis.current.del(catalog_keys.push("Catalog:#{self.id}:Keys"))
|
562
561
|
end
|
563
562
|
# Clear tmp holder
|
564
563
|
ActiveRecord::Base.connection.execute('UPDATE "public"."zuora_connect_app_instances" SET "catalog" = jsonb_set("catalog", \'{tmp}\', \'{}\'), "catalog_mapping" = jsonb_set("catalog_mapping", \'{tmp}\', \'{}\') where "id" = %{id}' % {:id => self.id})
|
@@ -593,7 +592,7 @@ module ZuoraConnect
|
|
593
592
|
end
|
594
593
|
|
595
594
|
if defined?(Redis.current) && object_id.present? && object_id.class == String && object_id.present?
|
596
|
-
stub_catalog = decrypt_data(data: Redis.current.get("Catalog:#{self.id}:#{object_id}:Children:#{child_objects}"))
|
595
|
+
stub_catalog = cache ? decrypt_data(data: Redis.current.get("Catalog:#{self.id}:#{object_id}:Children:#{child_objects}")) : nil
|
597
596
|
object_hierarchy = decrypt_data(data: Redis.current.get("Catalog:#{self.id}:#{object_id}:Hierarchy"))
|
598
597
|
end
|
599
598
|
|
@@ -711,9 +710,16 @@ module ZuoraConnect
|
|
711
710
|
stub_catalog ||= JSON.parse(ActiveRecord::Base.connection.execute(string).first["item"] || "{}")
|
712
711
|
|
713
712
|
if defined?(Redis.current) && object_id.present? && object_id.class == String && object_id.present?
|
714
|
-
|
715
|
-
|
713
|
+
if cache
|
714
|
+
Redis.current.sadd("Catalog:#{self.id}:Keys", ["Catalog:#{self.id}:#{object_id}:Hierarchy", "Catalog:#{self.id}:#{object_id}:Children:#{child_objects}"])
|
715
|
+
Redis.current.set("Catalog:#{self.id}:#{object_id}:Hierarchy", encrypt_data(data: object_hierarchy))
|
716
|
+
Redis.current.set("Catalog:#{self.id}:#{object_id}:Children:#{child_objects}", encrypt_data(data: stub_catalog))
|
717
|
+
else
|
718
|
+
Redis.current.sadd("Catalog:#{self.id}:Keys", ["Catalog:#{self.id}:#{object_id}:Hierarchy"])
|
719
|
+
Redis.current.set("Catalog:#{self.id}:#{object_id}:Hierarchy", encrypt_data(data: object_hierarchy))
|
720
|
+
end
|
716
721
|
end
|
722
|
+
|
717
723
|
return stub_catalog
|
718
724
|
end
|
719
725
|
### END Catalog Helping Methods #####
|