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 +4 -4
- data/app/models/concerns/zuora_connect/auditable.rb +25 -0
- data/config/initializers/postgresql_adapter.rb +1 -1
- data/lib/zuora_connect.rb +9 -3
- data/lib/zuora_connect/configuration.rb +1 -1
- data/lib/zuora_connect/controllers/helpers.rb +3 -3
- data/lib/zuora_connect/version.rb +2 -2
- metadata +5 -5
- data/lib/zuora_connect/zuora_audit.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93697b2f6ee9ddb200d9aafcf700e2305740617bbc0a8b216dc32b9fd33a3f2e
|
4
|
+
data.tar.gz: b88d5be07b1122372eb79b9aa74662f06ba3f522a64ba0177f62842db1fe29cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'] :
|
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)
|
@@ -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,
|
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,
|
555
|
+
ZuoraConnect.logger.warn("UI Authorization Error", ex, response: { params: final_error })
|
556
556
|
else
|
557
|
-
ZuoraConnect.logger.info("UI Authorization Error", ex,
|
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.
|
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.
|
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-
|
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: '
|
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: '
|
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
|