zuora_connect 2.0.60j → 2.0.60k

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
  SHA256:
3
- metadata.gz: 27a3847105e8376738ca1183becbbbaae8f6f1b8d5a6fad0dca2207bc8526da2
4
- data.tar.gz: 99d274d4cd3e5ab15f148fbda907aa51555c52f01c7acd3b88610b6d829d5351
3
+ metadata.gz: fe61d354796bd1cf1935f2787db0611bb2858393767db78230efb191cf64eabc
4
+ data.tar.gz: c5b22daf266f3cc696c1a85ac46e7b4242d75a59f094f2103edb1fa0da729df2
5
5
  SHA512:
6
- metadata.gz: 15e5d1d61dbf20dc6f51419482da3f5804a70e04b40febbee74588b8f7036ca2530aec84fdc58cbaa90add318f48d6c5318188b195e3f98d1fb181092104a732
7
- data.tar.gz: 1863947d49d8d854456466e17dc35183ba0bc36af30fa272027932bfdf8b0bc09bb98be525fc344ee9649670e1bae0285756838c80cc7d55e524d6dc81e22418
6
+ metadata.gz: 04b0bf5d380361c58279910595d0967fde34c00b05db703d2c4dda02a8205487eb8b0fd3c8bfc44d0c0997854cfacca9585c778e96000e938a19b8ee6604271c
7
+ data.tar.gz: 510d4eb2cd734f1082f887ff3924ce580658d4419929ee12db35acec17338785b8e9ecb64588307f3a6fe26adb29a8ed45c04df51a2964f1be9480880c2f2813
@@ -241,8 +241,22 @@ module ZuoraConnect
241
241
  ZuoraConnect.logger.error(ex) if !IGNORED_LOCALS.include?(ex.locale.to_s.downcase)
242
242
  end
243
243
 
244
- user = ZuoraConnect::ZuoraUser.order(updated_at: :desc).first
245
- self.user_timezone = user ? user.zuora_identity_response.values.first&.dig('timeZone') : nil
244
+ begin
245
+ sql = <<-eos
246
+ SELECT zuora_users.zuora_identity_response
247
+ FROM "#{self.id}".zuora_users
248
+ ORDER BY zuora_users.updated_at DESC
249
+ LIMIT 1;
250
+ eos
251
+ user = ActiveRecord::Base.connection.execute(sql).to_a.first
252
+
253
+ if user.present?
254
+ zuora_identity_response = JSON.parse(user.fetch('zuora_identity_response', '{}'))
255
+ self.user_timezone = zuora_identity_response.values.first&.dig('timeZone')
256
+ end
257
+ rescue => ex
258
+ Rails.logger.error('Failed to get users while setting app instance timezone', ex)
259
+ end
246
260
 
247
261
  if self.user_timezone.present?
248
262
  # connect instance which has a custom timezone
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.60j"
2
+ VERSION = "2.0.60k"
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.60j
4
+ version: 2.0.60k
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-10-29 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment