zuora_connect 1.7.20 → 1.7.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dd5a2b3b66e4bd5c43e2b9625c05ec541193c6f
4
- data.tar.gz: d292c7ab56c4b2038a93b0135845f8ad3c712bcb
3
+ metadata.gz: e2042593e49d99996fc3e0b4bb62d1fa715321da
4
+ data.tar.gz: c55c2a56f9402c714aae9db0df016b7b6506a1b1
5
5
  SHA512:
6
- metadata.gz: 8c3d103ea50e585639abe9fab959091cfc073ebf43ec756d64139c6839e491f0df7256de9a3a0e5dc997245da5853394573a6183b723302463d5526980221f67
7
- data.tar.gz: 8b94cc8937dff2f6f5e73667cf04706bd835c3479b37701453287227c7e8c2884ed4fb7f5b17b1243288f66705fccd9a8ef12dbdaca64fc306035c54115c1293
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.keys("Catalog:#{self.id}:*").each do |key|
560
- Redis.current.del(key.to_s)
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
- Redis.current.set("Catalog:#{self.id}:#{object_id}:Hierarchy", encrypt_data(data: object_hierarchy))
715
- Redis.current.set("Catalog:#{self.id}:#{object_id}:Children:#{child_objects}", encrypt_data(data: stub_catalog)) if cache
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 #####
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.7.20"
2
+ VERSION = "1.7.21"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.20
4
+ version: 1.7.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team