zuora_connect 2.0.49 → 2.0.50

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: 66e0c185eb5a4cd487c417c78ce7907bf52a9a1b14a181ad216a8dea8700f20c
4
- data.tar.gz: bff4d5e1efd62d4bae9f0171a1142da765da5e73a889e301696d5ee58ee66794
3
+ metadata.gz: ac63d84930258a8a27d1c150179f4350bb82391b43966f281f2d5438df626430
4
+ data.tar.gz: cf7d90134028cfde95364489b685172cbc38a1e97253d78f6fb2d75aad7a4452
5
5
  SHA512:
6
- metadata.gz: f662ae258af4280a65d0cd6ec4e61bbf429e4475a87c70b222d0626d5a81ed2bba17bfd9908eef502d0bc8ed039855badae826de94aeaa5d19ce15958d80b097
7
- data.tar.gz: f3f13b1d620b0aa387b82599aee3e678d9fbf54459d13e3c9794457f662c7f4ad6a4b5cbdac0e53e80db906d098f62558388bb4003a16465fad5d73f32411399
6
+ metadata.gz: a932232c898ef0f65677055094c3de1eeef0b67eee9a94345958c7858153f8f1371e8625865bd2b3e26ed034b85d141b6b8af8eb6925d1379bb8de855c539753
7
+ data.tar.gz: 0c4abe94469066d788b0fad912c9934620c6ea00255bd71ef56d575e5b97909ca8ea8811af1a74afae86b18aa0716a55b65cd43b968d3edbc846118d6e148f21
@@ -1123,6 +1123,8 @@ module ZuoraConnect
1123
1123
  ### END S3 Helping Methods #####
1124
1124
 
1125
1125
  ### START Aggregate Grouping Helping Methods ####
1126
+ # Traverse entire database and run a query on table(table_name) with where clause(where_clause)
1127
+ # Data from each schema will be loaded into table(aggregate_name) into the public schema
1126
1128
  def self.refresh_aggregate_table(aggregate_name: 'all_tasks_processing', table_name: 'tasks', where_clause: "where status in ('Processing', 'Queued')", index_table: true, ignore_indexes: [])
1127
1129
  self.update_functions
1128
1130
  if index_table
@@ -1132,8 +1134,12 @@ module ZuoraConnect
1132
1134
  end
1133
1135
  end
1134
1136
 
1137
+ # Load a psql script as a function in a transaction lock
1135
1138
  def self.update_functions
1136
- ActiveRecord::Base.connection.execute(File.read("#{Gem.loaded_specs["zuora_connect"].gem_dir}/app/views/sql/refresh_aggregate_table.txt"))
1139
+ ActiveRecord::Base.transaction do
1140
+ ActiveRecord::Base.connection.execute("SELECT pg_advisory_xact_lock(#{Zlib.crc32('refresh_aggregate_table')})")
1141
+ ActiveRecord::Base.connection.execute(File.read("#{Gem.loaded_specs["zuora_connect"].gem_dir}/app/views/sql/refresh_aggregate_table.txt"))
1142
+ end
1137
1143
  end
1138
1144
  ### END Aggregate Grouping Helping Methods #####
1139
1145
 
@@ -1156,15 +1162,13 @@ module ZuoraConnect
1156
1162
  end
1157
1163
 
1158
1164
  def reload_attributes(selected_attributes)
1159
- raise "Attibutes must be array" unless selected_attributes.is_a?(Array)
1160
- selected_attributes.push(:organizations, :environment, :zuora_tenant_ids)
1161
- selected_attributes.uniq!
1162
- value_attributes = self.class.unscoped.where(id: id).select(selected_attributes).first.attributes
1165
+ raise "Attibutes must be array" if selected_attributes.class != Array
1166
+ value_attributes = self.class.unscoped.where(:id=>id).select(selected_attributes).first.attributes
1163
1167
  value_attributes.each do |key, value|
1164
1168
  next if key == "id" && value.blank?
1165
1169
  self.send(:write_attribute, key, value)
1166
1170
  end
1167
- self
1171
+ return self
1168
1172
  end
1169
1173
 
1170
1174
  def instance_failure(failure)
@@ -92,7 +92,7 @@ module Resque
92
92
  log_with_severity :error, "Error reserving job: #{ex.inspect}"
93
93
  log_with_severity :error, ex.backtrace.join("\n")
94
94
  end
95
- raise ex
95
+ raise e
96
96
  end
97
97
 
98
98
  def create_job(queue, payload)
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.49"
2
+ VERSION = "2.0.50"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.49
4
+ version: 2.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-25 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment