zuora_connect 3.0.0.pre.v → 3.0.1.pre.a

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: 9b2de2915f49058f7897da39462cdb21d126e50b6c6be6f4002e2d293849e951
4
- data.tar.gz: 793a2abb6ae8c86c1c14f037aa63f55a2d21675ed8133bca1efd17d8dd506d70
3
+ metadata.gz: 93697b2f6ee9ddb200d9aafcf700e2305740617bbc0a8b216dc32b9fd33a3f2e
4
+ data.tar.gz: b88d5be07b1122372eb79b9aa74662f06ba3f522a64ba0177f62842db1fe29cc
5
5
  SHA512:
6
- metadata.gz: eff1f9628eedc98099ea3bfe3071d8e7aeaa281841df391b77c7f507eb82d67eecea83904b78459c8419ec765199c4d8181e4525f07fd874d6f7752b77194780
7
- data.tar.gz: f611645b03a5f35c4bf11b77af0017dc7c3b3ea9d5608a521f6defc67b2e359b5ff240d9fe6553a7a23868481b5e073b083ffc2edaba665844692ec241e01ea6
6
+ metadata.gz: c5bb290ae60c2375e0748a41dc6e8dfdc9b422f2718b24b81759f7985c947050afd0389fefa2d3950d240f1cf3c1f0432bd58aee33c1aa8deed46e46beab6107
7
+ data.tar.gz: 63703e115fea73c8aa32859719020a68c8e91cee2454260923fae72ebc3bd0e76e30607a526f98238ba8a1c85a828b892d46e99dddf4adea96228d6f2fe60396
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ZuoraConnect
4
+ # Added by @Vina
5
+ # Description: This automatically stamp user created/updated the record for DataQuery Audit
6
+ # Usage: add 'include ZuoraConnect::Auditable' to your model.rb that you would like to track
7
+ module Auditable
8
+ extend ActiveSupport::Concern
9
+
10
+ included do
11
+ before_create :set_created_by_id
12
+ before_update :set_updated_by_id
13
+
14
+ private
15
+
16
+ def set_created_by_id
17
+ self.created_by_id = ZuoraUser.current_user_id if defined?(created_by_id)
18
+ end
19
+
20
+ def set_updated_by_id
21
+ self.updated_by_id = ZuoraUser.current_user_id if defined?(updated_by_id)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -10,7 +10,7 @@ module ActiveRecord
10
10
 
11
11
  return if loaded_from_cache?(initializer)
12
12
 
13
- if supports_ranges?
13
+ if Rails::VERSION::MAJOR >= 6 || supports_ranges?
14
14
  query = <<-SQL
15
15
  SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
16
16
  FROM pg_type as t
data/lib/zuora_connect.rb CHANGED
@@ -11,10 +11,8 @@ require 'resque/plugins/custom_logger'
11
11
  require 'resque/plugins/app_instance_job'
12
12
  require 'metrics/influx/point_value'
13
13
  require 'metrics/net'
14
- require 'zuora_connect/zuora_audit'
15
14
  require 'active_record'
16
15
  require 'zuora_observability'
17
- ::ActiveRecord::Base.send :include, ZuoraConnect::ZuoraAudit
18
16
 
19
17
  module ZuoraConnect
20
18
  class << self
@@ -31,6 +29,14 @@ module ZuoraConnect
31
29
  @logger ||= ZuoraObservability::Logger.custom_logger(name: "Connect", level: Rails.logger.level)
32
30
  end
33
31
  end
32
+
33
+ def app_name
34
+ if Rails::VERSION::MAJOR >= 6
35
+ Rails.application.class.module_parent_name
36
+ else
37
+ Rails.application.class.parent_name
38
+ end
39
+ end
34
40
  end
35
41
 
36
42
  module Controllers
@@ -86,7 +92,7 @@ module ZuoraConnect
86
92
  ignore_url_patterns: ['^\/admin\/resque.*', '^\/admin\/redis.*', '^\/admin\/peek.*', '^\/peek.*'],
87
93
  verify_server_cert: false,
88
94
  log_level: Logger::INFO,
89
- service_name: ENV['DEIS_APP'].present? ? ENV['DEIS_APP'] : Rails.application.class.parent_name,
95
+ service_name: ENV['DEIS_APP'].present? ? ENV['DEIS_APP'] : ZuoraConnect.app_name,
90
96
  logger: ZuoraObservability::Logger.custom_logger(name: "ElasticAPM", level: Logger::WARN)
91
97
  })
92
98
  defaults.merge!({disable_send: true}) if defined?(Rails::Console)
@@ -43,7 +43,7 @@ module ZuoraConnect
43
43
  @dev_mode_access_key_id = nil
44
44
  @aws_region = "us-west-2"
45
45
  @s3_bucket_name = "rbm-apps"
46
- @s3_folder_name = Rails.application.class.parent_name
46
+ @s3_folder_name = ZuoraConnect.app_name
47
47
  end
48
48
 
49
49
  def private_key
@@ -550,11 +550,11 @@ module ZuoraConnect
550
550
  final_error = output_xml.xpath('//fns:FaultCode', 'fns' =>'http://fault.api.zuora.com/').text
551
551
  session.clear
552
552
  if final_error.blank?
553
- ZuoraConnect.logger.warn("UI Authorization Error", ex, zuora: zuora_details.merge({:error => response.body}))
553
+ ZuoraConnect.logger.warn("UI Authorization Error", ex, response: { params: response.body })
554
554
  elsif final_error != "INVALID_SESSION"
555
- ZuoraConnect.logger.warn("UI Authorization Error", ex, zuora: zuora_details.merge({:error => final_error}))
555
+ ZuoraConnect.logger.warn("UI Authorization Error", ex, response: { params: final_error })
556
556
  else
557
- ZuoraConnect.logger.info("UI Authorization Error", ex, zuora: zuora_details.merge({:error => final_error}))
557
+ ZuoraConnect.logger.info("UI Authorization Error", ex, response: { params: final_error })
558
558
  end
559
559
  redirect_to "https://#{zuora_host}/apps/newlogin.do?retURL=#{request.fullpath}"
560
560
  return
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "3.0.0-v"
3
- end
2
+ VERSION = "3.0.1-a"
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: 3.0.0.pre.v
4
+ version: 3.0.1.pre.a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 4.1.0
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
- version: '5.3'
112
+ version: '6.1'
113
113
  type: :runtime
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ dependencies:
119
119
  version: 4.1.0
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: '5.3'
122
+ version: '6.1'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: raindrops
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -352,6 +352,7 @@ files:
352
352
  - app/controllers/zuora_connect/static_controller.rb
353
353
  - app/helpers/zuora_connect/api/v1/app_instance_helper.rb
354
354
  - app/helpers/zuora_connect/application_helper.rb
355
+ - app/models/concerns/zuora_connect/auditable.rb
355
356
  - app/models/zuora_connect/app_instance.rb
356
357
  - app/models/zuora_connect/app_instance_base.rb
357
358
  - app/models/zuora_connect/login.rb
@@ -411,7 +412,6 @@ files:
411
412
  - lib/zuora_connect/exceptions.rb
412
413
  - lib/zuora_connect/railtie.rb
413
414
  - lib/zuora_connect/version.rb
414
- - lib/zuora_connect/zuora_audit.rb
415
415
  homepage:
416
416
  licenses: []
417
417
  metadata: {}
@@ -1,31 +0,0 @@
1
- # Added by @Vina
2
- # Description: This automatically stamp user created/updated the record for DataQuery Audit
3
- # Usage: add 'zuora_audit' to your model.rb that you would like to track
4
-
5
- module ZuoraConnect
6
- module ZuoraAudit
7
- extend ActiveSupport::Concern
8
-
9
- module ClassMethods
10
- def zuora_audit
11
- include ZuoraConnect::ZuoraAudit::ZuoraAuditInstanceMethods
12
- before_create :set_created_by_id
13
- before_update :set_updated_by_id
14
- end
15
- end
16
-
17
- module ZuoraAuditInstanceMethods
18
- def set_created_by_id
19
- self.created_by_id = current_user_id if defined?(self.created_by_id)
20
- end
21
-
22
- def set_updated_by_id
23
- self.updated_by_id = current_user_id if defined?(self.updated_by_id)
24
- end
25
-
26
- def current_user_id
27
- return ZuoraConnect::ZuoraUser.current_user_id
28
- end
29
- end
30
- end
31
- end