ledger_sync-domains 1.0.0.rc9 → 1.0.2

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: 377ed25fb6116641163aec85a9a0afded48c610af12aeada34832d466002f6d7
4
- data.tar.gz: 5c07d5701c4a73d535b613f3228fd7c7d205a33f0e748869041f7f440bbef263
3
+ metadata.gz: d1fb828826dc023ee107776c16eb98f31851901369f594df39054efe19cf432c
4
+ data.tar.gz: 8317376fdcb39e6eb28750dbf6f74cc4e873190a4b1ce9b121682ed056ad2a9a
5
5
  SHA512:
6
- metadata.gz: d2faddd5b6e3d96b1d8d5414e3f779ec17e3aafd826f39ea95577fa99780228264fba9094d5adbcf582b05f1be1e49637ae06944bdc0c176f867b9b5827b467b
7
- data.tar.gz: 1d3859cad01a16b8505b3eef05b3287971ca9344b4f983a776ea12c34a449fdd685dc185c8519691643220fe169e57491d5fc1d5cec3e7e558ed6c7f2795c42f
6
+ metadata.gz: 99a9d86a95ade23fadf90f3ec19c67b0a7176d5b40ab27f8c9d41bc56060c7262488b3dceff344cdf20f87c1ba16122626f8c61b94205c424e89d7c8857f8b64
7
+ data.tar.gz: 016733a34a47b67aa01c691bb615882b5a8363aeea9f2e83450633b8f0f19f88f3e68aeeeab6332e8223cd294c5798e5fcabfa0c26f33be03526904230abba3d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.2] - 2022-01-25
4
+
5
+ - Fix: Include extra query filtering in Operations
6
+ - Fix: Error return after validation falied in perform action of operation class.
7
+
8
+ ## [1.0.1] - 2021-12-21
9
+
10
+ - Fix: Removing constant is private method. Sigh.
11
+
12
+ ## [1.0.0] - 2021-12-20
13
+
14
+ - Chore: Cleanup existing structs when serializing
15
+
3
16
  ## [1.0.0.rc9] - 2021-12-19
4
17
 
5
18
  - Fix: Cleanup serialization from predefined ActiveRecord operations
@@ -19,7 +32,7 @@
19
32
  ## [1.0.0.rc5] - 2021-11-05
20
33
 
21
34
  - Add: Introduce Serializer::Relation to proxy AR Queries
22
- - Refactor Struct out of Serializer
35
+ - Chore: Refactor Struct out of Serializer
23
36
 
24
37
  ## [1.0.0.rc4] - 2021-09-23
25
38
 
@@ -31,7 +44,7 @@
31
44
 
32
45
  ## [1.0.0.rc2] - 2021-09-06
33
46
 
34
- - Serialized OpenStruct uses serializer-like class name
47
+ - Add: Serialized OpenStruct uses serializer-like class name
35
48
 
36
49
  ## [1.0.0.rc1] - 2021-08-31
37
50
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ledger_sync-domains (1.0.0.rc9)
4
+ ledger_sync-domains (1.0.2)
5
5
  ledger_sync (~> 2.3.1)
6
6
 
7
7
  GEM
@@ -20,7 +20,7 @@ GEM
20
20
  concurrent-ruby (1.1.9)
21
21
  diff-lcs (1.4.4)
22
22
  dotenv (2.7.6)
23
- dry-configurable (0.13.0)
23
+ dry-configurable (0.14.0)
24
24
  concurrent-ruby (~> 1.0)
25
25
  dry-core (~> 0.6)
26
26
  dry-container (0.9.0)
@@ -29,7 +29,7 @@ GEM
29
29
  dry-core (0.7.1)
30
30
  concurrent-ruby (~> 1.0)
31
31
  dry-inflector (0.2.1)
32
- dry-initializer (3.0.4)
32
+ dry-initializer (3.1.1)
33
33
  dry-logic (1.2.0)
34
34
  concurrent-ruby (~> 1.0)
35
35
  dry-core (~> 0.5, >= 0.5)
@@ -54,27 +54,31 @@ GEM
54
54
  dry-schema (~> 1.8, >= 1.8.0)
55
55
  factory_bot (6.2.0)
56
56
  activesupport (>= 5.0.0)
57
- faraday (1.8.0)
57
+ faraday (1.9.3)
58
58
  faraday-em_http (~> 1.0)
59
59
  faraday-em_synchrony (~> 1.0)
60
60
  faraday-excon (~> 1.1)
61
- faraday-httpclient (~> 1.0.1)
61
+ faraday-httpclient (~> 1.0)
62
+ faraday-multipart (~> 1.0)
62
63
  faraday-net_http (~> 1.0)
63
- faraday-net_http_persistent (~> 1.1)
64
+ faraday-net_http_persistent (~> 1.0)
64
65
  faraday-patron (~> 1.0)
65
66
  faraday-rack (~> 1.0)
66
- multipart-post (>= 1.2, < 3)
67
+ faraday-retry (~> 1.0)
67
68
  ruby2_keywords (>= 0.0.4)
68
- faraday-detailed_logger (2.4.2)
69
- faraday (>= 0.16, < 2)
69
+ faraday-detailed_logger (2.5.0)
70
+ faraday (>= 0.16, < 3)
70
71
  faraday-em_http (1.0.0)
71
72
  faraday-em_synchrony (1.0.0)
72
73
  faraday-excon (1.1.0)
73
74
  faraday-httpclient (1.0.1)
75
+ faraday-multipart (1.0.3)
76
+ multipart-post (>= 1.2, < 3)
74
77
  faraday-net_http (1.0.1)
75
78
  faraday-net_http_persistent (1.2.0)
76
79
  faraday-patron (1.0.0)
77
80
  faraday-rack (1.0.0)
81
+ faraday-retry (1.0.3)
78
82
  faraday_middleware (1.2.0)
79
83
  faraday (~> 1.0)
80
84
  fingerprintable (1.2.1)
@@ -99,7 +103,7 @@ GEM
99
103
  simply_serializable (>= 1.5.1)
100
104
  minitest (5.15.0)
101
105
  multipart-post (2.1.1)
102
- nokogiri (1.12.5-x86_64-linux)
106
+ nokogiri (1.13.1-x86_64-linux)
103
107
  racc (~> 1.4)
104
108
  openssl (2.2.1)
105
109
  ipaddr
@@ -10,7 +10,7 @@ module LedgerSync
10
10
  class Contract < LedgerSync::Ledgers::Contract
11
11
  params do
12
12
  required(:id).filled(:integer)
13
- required(:limit).value(:hash)
13
+ required(:query).value(:hash)
14
14
  end
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module LedgerSync
25
25
  end
26
26
 
27
27
  def resource
28
- @resource ||= resource_class.find_by(id: params[:id])
28
+ @resource ||= resource_class.where(params[:query]).find_by(id: params[:id])
29
29
  end
30
30
 
31
31
  def success
@@ -7,6 +7,13 @@ module LedgerSync
7
7
  module Domains
8
8
  class Operation
9
9
  class Remove < Resource
10
+ class Contract < LedgerSync::Ledgers::Contract
11
+ params do
12
+ required(:id).filled(:integer)
13
+ required(:query).value(:hash)
14
+ end
15
+ end
16
+
10
17
  private
11
18
 
12
19
  def operate
@@ -23,7 +30,7 @@ module LedgerSync
23
30
  end
24
31
 
25
32
  def resource
26
- @resource ||= resource_class.find_by(id: params[:id])
33
+ @resource ||= resource_class.where(params[:query]).find_by(id: params[:id])
27
34
  end
28
35
 
29
36
  def success
@@ -7,6 +7,13 @@ module LedgerSync
7
7
  module Domains
8
8
  class Operation
9
9
  class Update < Resource
10
+ class Contract < LedgerSync::Ledgers::Contract
11
+ params do
12
+ required(:id).filled(:integer)
13
+ required(:query).value(:hash)
14
+ end
15
+ end
16
+
10
17
  private
11
18
 
12
19
  def operate
@@ -23,7 +30,7 @@ module LedgerSync
23
30
  end
24
31
 
25
32
  def resource
26
- @resource ||= resource_class.find_by(id: params[:id])
33
+ @resource ||= resource_class.where(params[:query]).find_by(id: params[:id])
27
34
  end
28
35
 
29
36
  def success
@@ -84,10 +84,7 @@ module LedgerSync
84
84
  )
85
85
  end
86
86
 
87
- unless valid?
88
- failure(errors)
89
- return
90
- end
87
+ return failure(errors) unless valid?
91
88
 
92
89
  @result = begin
93
90
  operate
@@ -159,7 +156,7 @@ module LedgerSync
159
156
 
160
157
  def deep_serialize(value)
161
158
  case value
162
- when ActiveRecord::Base#, LedgerSync::Resource
159
+ when ActiveRecord::Base # , LedgerSync::Resource
163
160
  serialize(resource: value)
164
161
  when Hash
165
162
  value.transform_values { deep_serialize(_1) }
@@ -53,9 +53,8 @@ module LedgerSync
53
53
  class_name = name.pop.gsub(/[^0-9a-z ]/i, '').gsub(/.*\KSerializer/, '')
54
54
  struct_name = "#{class_name}Struct"
55
55
  module_name = name.empty? ? Object : Object.const_get(name.join('::'))
56
- unless module_name.const_defined?(struct_name)
57
- module_name.const_set(struct_name, Class.new(OpenStruct))
58
- end
56
+ # module_name.remove_const(struct_name) if module_name.const_defined?(struct_name)
57
+ module_name.const_set(struct_name, Class.new(OpenStruct))
59
58
 
60
59
  klass.with_lazy_references(
61
60
  hash,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LedgerSync
4
4
  module Domains
5
- VERSION = '1.0.0.rc9'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_sync-domains
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc9
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jozef Vaclavik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-19 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ledger_sync
@@ -119,9 +119,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  version: 2.7.2
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.1
124
+ version: '0'
125
125
  requirements: []
126
126
  rubygems_version: 3.2.9
127
127
  signing_key: