ledger_sync-domains 1.0.1 → 1.0.5

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: cfad9de4dbe74676429795415511fd9874f332f160ae7c121d8d1a61ca8afefa
4
- data.tar.gz: 640a6b9b508313c156d559da4fb1d0baf3161752e3229147cde27f0354f942c5
3
+ metadata.gz: 4b398d8316044137a5be5aa09d84cbea013214c0d55c1e795b3b38282a358880
4
+ data.tar.gz: 72d5b689d52f69b0c91044e59797b091ead5538f520505e68cbab6dbb007e123
5
5
  SHA512:
6
- metadata.gz: 020124a36b0c66859d443a06a7c8445490dcd67dca4820c5ae7853c6a967cc7cc19838d55475ed42f80e1e3688b0ec1473defc411487e4bfb8eb568e37101c64
7
- data.tar.gz: 998ef055f3710f630cf24b6a24991fdb53efcf39d682b046e1b2101a0cd86301223bfa0769083220b87ea9ee2f96eabfeaad906ea1b8568919941036f14e8377
6
+ metadata.gz: c39fc0b7a073409f3176d419313201ca442f84eb2e809f80aebb3a76fc1df31f5b09ff203883537dd674250b611e8f79fb096661828d31682621cd2b96a04cf8
7
+ data.tar.gz: 7acd76c5877dab79f1ada5443ff0dfbc6d870f3c9205f45dc05b3dfa1e739c80465dc25515a4e964555dad9eb0143b4306aaf1463f0f9bfdc960409236f73e81
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.5] - 2022-02-17
4
+
5
+ - Fix: Do not serialize unset reader relational method
6
+
7
+ ## [1.0.4] - 2022-02-15
8
+
9
+ - Fix: Do not serialize unset relationships
10
+
11
+ ## [1.0.3] - 2022-02-12
12
+
13
+ - Fix: Resource shorthand operations uses limit instead of query
14
+
15
+ ## [1.0.2] - 2022-01-25
16
+
17
+ - Fix: Include extra query filtering in Operations
18
+ - Fix: Error return after validation falied in perform action of operation class.
19
+
3
20
  ## [1.0.1] - 2021-12-21
4
21
 
5
22
  - Fix: Removing constant is private method. Sigh.
@@ -27,7 +44,7 @@
27
44
  ## [1.0.0.rc5] - 2021-11-05
28
45
 
29
46
  - Add: Introduce Serializer::Relation to proxy AR Queries
30
- - Refactor Struct out of Serializer
47
+ - Chore: Refactor Struct out of Serializer
31
48
 
32
49
  ## [1.0.0.rc4] - 2021-09-23
33
50
 
@@ -39,7 +56,7 @@
39
56
 
40
57
  ## [1.0.0.rc2] - 2021-09-06
41
58
 
42
- - Serialized OpenStruct uses serializer-like class name
59
+ - Add: Serialized OpenStruct uses serializer-like class name
43
60
 
44
61
  ## [1.0.0.rc1] - 2021-08-31
45
62
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ledger_sync-domains (1.0.1)
4
+ ledger_sync-domains (1.0.5)
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,11 +29,11 @@ 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)
36
- dry-schema (1.8.0)
36
+ dry-schema (1.9.1)
37
37
  concurrent-ruby (~> 1.0)
38
38
  dry-configurable (~> 0.13, >= 0.13.0)
39
39
  dry-core (~> 0.5, >= 0.5)
@@ -46,42 +46,46 @@ GEM
46
46
  dry-core (~> 0.5, >= 0.5)
47
47
  dry-inflector (~> 0.1, >= 0.1.2)
48
48
  dry-logic (~> 1.0, >= 1.0.2)
49
- dry-validation (1.7.0)
49
+ dry-validation (1.8.0)
50
50
  concurrent-ruby (~> 1.0)
51
51
  dry-container (~> 0.7, >= 0.7.1)
52
52
  dry-core (~> 0.5, >= 0.5)
53
53
  dry-initializer (~> 3.0)
54
- dry-schema (~> 1.8, >= 1.8.0)
54
+ dry-schema (~> 1.9, >= 1.9.1)
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)
81
85
  colorize
82
86
  i18n (1.8.11)
83
87
  concurrent-ruby (~> 1.0)
84
- ipaddr (1.2.3)
88
+ ipaddr (1.2.4)
85
89
  ledger_sync (2.3.1)
86
90
  activemodel
87
91
  dry-schema
@@ -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
@@ -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[:limit]).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(:limit).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[:limit]).find_by(id: params[:id])
27
34
  end
28
35
 
29
36
  def success
@@ -14,6 +14,7 @@ module LedgerSync
14
14
  required(:event).value(:string)
15
15
  required(:attrs).maybe(:hash)
16
16
  required(:attrs).maybe(:array)
17
+ required(:limit).value(:hash)
17
18
  end
18
19
  end
19
20
 
@@ -41,7 +42,7 @@ module LedgerSync
41
42
  end
42
43
 
43
44
  def resource
44
- @resource ||= resource_class.find_by(id: params[:id])
45
+ @resource ||= resource_class.where(params[:limit]).find_by(id: params[:id])
45
46
  end
46
47
 
47
48
  def resource_class
@@ -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(:limit).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[:limit]).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
@@ -41,6 +41,7 @@ module LedgerSync
41
41
  READER_METHODS.each do |name|
42
42
  define_method(name) do |*args, **params, &block|
43
43
  item = @query.send(name, *args, **params, &block)
44
+ return nil unless item
44
45
 
45
46
  @serializer.serialize(resource: item)
46
47
  end
@@ -100,6 +101,7 @@ module LedgerSync
100
101
  class SerializerReferencesOneType
101
102
  def proxy(serializer:, resource:, attribute:)
102
103
  item = resource.try(attribute)
104
+ return nil unless item
103
105
 
104
106
  serializer.serialize(resource: item)
105
107
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LedgerSync
4
4
  module Domains
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.5'
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.1
4
+ version: 1.0.5
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-20 00:00:00.000000000 Z
11
+ date: 2022-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ledger_sync