zuora_connect 2.0.60l → 2.0.60m

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: 00f68595c6354e9924c2e73bdb81246bdc858874f49830f94111e0d46b6e8298
4
- data.tar.gz: 1b01b3c05190970c9ad92c461f64b89787b790f3e2ffb6394831ccce425e0d1a
3
+ metadata.gz: ea7bbbca4b37f1429f97fd4f2d173efba916f3b72616bbd5713b610b5269c7e1
4
+ data.tar.gz: 1fa5fd61bb859cf74b669eab6f6e1cc94672a46d5b261d73fa43fd6bde126751
5
5
  SHA512:
6
- metadata.gz: e58fc8cd5b36a2be218afab342507a78acb5221001cdc712e61a7e80ad0615797ed42c7ae413d4d5dc179d14784e91eb621ea5be9466a45e904ed97bd5996076
7
- data.tar.gz: df3730519a5b2b1e8b3778866bd6ac59255633666522fe7ec8522e6815a1c87d5aba89fd733ec1eaecf6caeccf74fde010ea40a9d882b20d6fe2cfc4f1ee46a2
6
+ metadata.gz: dd9b858b6e5478d7131b4b1119769c7dc95c881eca6439fa651711c87104d7cb3a656a6731a01090c99b5b6841b93d1b6c539b9218efa2a691b46d9912eff680
7
+ data.tar.gz: ecd6b793f756cc670d4c38d0366edd54d7eceb1a67d50b1dbff20b81b9da343b0da9dc978e0a9d88ff30c1aae040822491c07179da2d6f5d1ceef1607f491049
@@ -2,6 +2,6 @@ module ZuoraConnect
2
2
  class ZuoraUser < ActiveRecord::Base
3
3
  self.table_name = "zuora_users"
4
4
  attr_accessor :session
5
-
5
+ attr_accessor :current_user
6
6
  end
7
7
  end
@@ -13,6 +13,9 @@ require 'logging/connect_formatter'
13
13
  require 'metrics/influx/point_value'
14
14
  require 'metrics/net'
15
15
  require 'mono_logger'
16
+ require 'zuora_connect/zuora_audit'
17
+ require 'active_record'
18
+ ::ActiveRecord::Base.send :include, ZuoraConnect::ZuoraAudit
16
19
 
17
20
  module ZuoraConnect
18
21
  class << self
@@ -442,6 +442,7 @@ module ZuoraConnect
442
442
  @zuora_user = ZuoraConnect::ZuoraUser.create!(:zuora_user_id => zuora_user_id, :zuora_identity_response => {zuora_entity_id => session["ZuoraCurrentIdentity"]})
443
443
  end
444
444
  @zuora_user.session = session
445
+ ZuoraConnect::ZuoraUser.current_user = @zuora_user
445
446
  session["#{@appinstance.id}::user::localUserId"] = @zuora_user.id
446
447
  session["#{@appinstance.id}::user::email"] = session['ZuoraCurrentIdentity']["username"]
447
448
  session["#{@appinstance.id}::user::timezone"] = session['ZuoraCurrentIdentity']["timeZone"]
@@ -684,6 +685,7 @@ module ZuoraConnect
684
685
  key = ZuoraConnect.configuration.dev_mode_pass
685
686
  values = {:user => user , :key => key, :appinstance => session["appInstance"]}
686
687
  @appinstance = ZuoraConnect::AppInstance.find_by(:id => values[:appinstance].to_i)
688
+ ZuoraConnect::ZuoraUser.current_user = user
687
689
  if @appinstance.blank?
688
690
  Apartment::Tenant.switch!("public")
689
691
  begin
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.60l"
2
+ VERSION = "2.0.60m"
3
3
  end
@@ -0,0 +1,31 @@
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
+ after_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
28
+ end
29
+ end
30
+ end
31
+ 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.60l
4
+ version: 2.0.60m
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-11-04 00:00:00.000000000 Z
11
+ date: 2020-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -374,6 +374,7 @@ files:
374
374
  - lib/zuora_connect/exceptions.rb
375
375
  - lib/zuora_connect/railtie.rb
376
376
  - lib/zuora_connect/version.rb
377
+ - lib/zuora_connect/zuora_audit.rb
377
378
  - test/controllers/zuora_connect/api/v1/app_instance_controller_test.rb
378
379
  - test/dummy/README.rdoc
379
380
  - test/dummy/Rakefile