istox 0.2.8 → 0.2.9

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: 994fc5810c55f2637b138a872add0d6cc3eb3b3b0f4720d3121ada69bffcd037
4
- data.tar.gz: f90911bd0bb0673a231e76fa4f26820b0ba96039d745aa2f23d0dd09be3e9e3f
3
+ metadata.gz: b906e9dbba05e70feaf86f32baac44406b99092e766673c68b6ea264db7a9ddc
4
+ data.tar.gz: 1170ef8daccda9dceb671598f3ebb74e9071fc6e142ba4c0aa90c35aa21fc22f
5
5
  SHA512:
6
- metadata.gz: a8973bb6040837fd3937f0e85576c8e312a1485dbed490e1d9981a5e7fee3762707443f64194df33f69940072c59a627ea9442495959bbae59b80694de929971
7
- data.tar.gz: bc817295ac6e4b1d82ec546f7c0537d23d2e2dc980b02c735aa05e5c97d1fd959bc9f8d1189cf03afe6509be87b0bc078b8865a8b0c9fc2bdc214203ec7f2556
6
+ metadata.gz: a1f9dc10064f5527c503564078a02a7a6a219e57a03f6c152653f66e79050005cc0404bd639b8f18f870184811e3c0c2e874b45e73723e89b19c9f1fc0bfa10c
7
+ data.tar.gz: 6a604074785ecbcb31e10bbc37230f1ad7290aa7315c6b02b1c5ab14c4d0c8a572c441ae291c53e61ca31a87939fa12b4bfceb472f8bb08b38921d4c9aa15c66
@@ -8,18 +8,18 @@ module Istox
8
8
  @@blockchain_receipt_klass
9
9
  end
10
10
 
11
- def self.request(sid:, action:, before:, execute:, request_reason: nil)
12
- start(sid: sid, action: action, before: before, execute: execute, is_request: true, request_reason: request_reason)
11
+ def self.request(sid:, action:, before:, execute:, before_start: nil, request_reason: nil)
12
+ start(sid: sid, action: action, before: before, before_start: before_start, execute: execute, is_request: true, request_reason: request_reason)
13
13
  end
14
14
 
15
- def self.run(sid:, action:, before:, execute:)
16
- start(sid: sid, action: action, before: before, execute: execute)
15
+ def self.run(sid:, action:, before:, execute:, before_start: nil)
16
+ start(sid: sid, action: action, before: before, before_start: before_start, execute: execute)
17
17
  end
18
18
  class << self
19
19
  private
20
20
 
21
21
  # before is the proc that will be executed before, must return the main model blockchain receipt will bind to
22
- def start(sid:, action:, before:, execute:, is_request: false, request_reason: nil)
22
+ def start(sid:, action:, before:, execute:, before_start: nil, is_request: false, request_reason: nil)
23
23
  # create blockchain receipt first
24
24
  klass = blockchain_receipt_class
25
25
  uuid = ::SecureRandom.uuid
@@ -33,6 +33,8 @@ module Istox
33
33
 
34
34
  chainhub_processing = true
35
35
 
36
+ before_start.call(uuid) if before_start.present?
37
+
36
38
  ::ActiveRecord::Base.transaction do
37
39
  # execute before proc, and get the model that blockchain receipt should bind to
38
40
  model = before.call(uuid)
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.8'.freeze
2
+ VERSION = '0.2.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print