ledger_sync-domains 1.1.1 → 1.2.0
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 +4 -4
- data/CHANGELOG.md +17 -1
- data/Gemfile.lock +13 -10
- data/lib/ledger_sync/domains/operation.rb +3 -2
- data/lib/ledger_sync/domains/serializer/struct.rb +19 -3
- data/lib/ledger_sync/domains/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77a744d4de0e8b4cefe00a0dec3bee88a317655d9bec7ab3eebfe7aacba4251f
|
|
4
|
+
data.tar.gz: a979fa7e1c80a9d9bfac2c317b2fb5eb22fea25fc17a4bf4952c53ce4add55c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71b00186f1c6fff136958145c83018550a48d69c27777462994194d70b3ad20db5b05256a71562ce9d366007e7bb61a85a947e7cd4c33cffb199cabb215e3282
|
|
7
|
+
data.tar.gz: f6e0b8ae9d2efe5247535dfe82ca6adaa3f5cdb8431185a028ec8c5b6ffc02d3739057d209e1e0d53d8521718282b30bd9d4594ea3f62c0dc44d3f34378e55d1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.2.0] - 2022-07-07
|
|
4
|
+
|
|
5
|
+
- Feature: Add proxy methos to make Serialized resources work nice with rails forms
|
|
6
|
+
|
|
7
|
+
## [1.1.4] - 2022-05-26
|
|
8
|
+
|
|
9
|
+
- Feature: Operation accepts custom serializer
|
|
10
|
+
|
|
11
|
+
## [1.1.3] - 2022-04-08
|
|
12
|
+
|
|
13
|
+
- Fix: Nasty typo
|
|
14
|
+
|
|
15
|
+
## [1.1.2] - 2022-04-08
|
|
16
|
+
|
|
17
|
+
- Fix: Disable previous definition warning
|
|
18
|
+
|
|
3
19
|
## [1.1.1] - 2022-03-17
|
|
4
20
|
|
|
5
21
|
- Feature: Refactor Relation into Query for use outside of relationships
|
|
@@ -13,7 +29,7 @@
|
|
|
13
29
|
|
|
14
30
|
## [1.0.5] - 2022-02-17
|
|
15
31
|
|
|
16
|
-
- Fix: Do not serialize unset reader relational method
|
|
32
|
+
- Fix: Do not serialize unset reader relational method
|
|
17
33
|
|
|
18
34
|
## [1.0.4] - 2022-02-15
|
|
19
35
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ledger_sync-domains (1.
|
|
4
|
+
ledger_sync-domains (1.2.0)
|
|
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.
|
|
23
|
+
dry-configurable (0.15.0)
|
|
24
24
|
concurrent-ruby (~> 1.0)
|
|
25
25
|
dry-core (~> 0.6)
|
|
26
26
|
dry-container (0.9.0)
|
|
@@ -33,7 +33,7 @@ GEM
|
|
|
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.9.
|
|
36
|
+
dry-schema (1.9.3)
|
|
37
37
|
concurrent-ruby (~> 1.0)
|
|
38
38
|
dry-configurable (~> 0.13, >= 0.13.0)
|
|
39
39
|
dry-core (~> 0.5, >= 0.5)
|
|
@@ -46,12 +46,12 @@ 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.8.
|
|
49
|
+
dry-validation (1.8.1)
|
|
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.
|
|
54
|
+
dry-schema (~> 1.8, >= 1.8.0)
|
|
55
55
|
factory_bot (6.2.0)
|
|
56
56
|
activesupport (>= 5.0.0)
|
|
57
57
|
faraday (1.10.0)
|
|
@@ -72,8 +72,8 @@ GEM
|
|
|
72
72
|
faraday-em_synchrony (1.0.0)
|
|
73
73
|
faraday-excon (1.1.0)
|
|
74
74
|
faraday-httpclient (1.0.1)
|
|
75
|
-
faraday-multipart (1.0.
|
|
76
|
-
multipart-post (
|
|
75
|
+
faraday-multipart (1.0.4)
|
|
76
|
+
multipart-post (~> 2)
|
|
77
77
|
faraday-net_http (1.0.1)
|
|
78
78
|
faraday-net_http_persistent (1.2.0)
|
|
79
79
|
faraday-patron (1.0.0)
|
|
@@ -102,8 +102,10 @@ GEM
|
|
|
102
102
|
resonad
|
|
103
103
|
simply_serializable (>= 1.5.1)
|
|
104
104
|
minitest (5.15.0)
|
|
105
|
-
multipart-post (2.
|
|
106
|
-
nokogiri (1.13.
|
|
105
|
+
multipart-post (2.2.3)
|
|
106
|
+
nokogiri (1.13.6-arm64-darwin)
|
|
107
|
+
racc (~> 1.4)
|
|
108
|
+
nokogiri (1.13.6-x86_64-linux)
|
|
107
109
|
racc (~> 1.4)
|
|
108
110
|
openssl (2.2.1)
|
|
109
111
|
ipaddr
|
|
@@ -113,7 +115,7 @@ GEM
|
|
|
113
115
|
pd_ruby (0.2.3)
|
|
114
116
|
colorize
|
|
115
117
|
racc (1.6.0)
|
|
116
|
-
rack (2.2.
|
|
118
|
+
rack (2.2.4)
|
|
117
119
|
rainbow (3.0.0)
|
|
118
120
|
rake (13.0.6)
|
|
119
121
|
regexp_parser (2.2.0)
|
|
@@ -152,6 +154,7 @@ GEM
|
|
|
152
154
|
unicode-display_width (2.1.0)
|
|
153
155
|
|
|
154
156
|
PLATFORMS
|
|
157
|
+
arm64-darwin-21
|
|
155
158
|
x86_64-linux
|
|
156
159
|
|
|
157
160
|
DEPENDENCIES
|
|
@@ -60,8 +60,9 @@ module LedgerSync
|
|
|
60
60
|
|
|
61
61
|
attr_reader :params, :result
|
|
62
62
|
|
|
63
|
-
def initialize(domain:, **params)
|
|
63
|
+
def initialize(domain:, serializer: nil, **params)
|
|
64
64
|
@domain = domain
|
|
65
|
+
@serializer = serializer
|
|
65
66
|
@params = params
|
|
66
67
|
@result = nil
|
|
67
68
|
end
|
|
@@ -112,7 +113,7 @@ module LedgerSync
|
|
|
112
113
|
end
|
|
113
114
|
|
|
114
115
|
def serializer_for(resource:)
|
|
115
|
-
serializer_class_for(resource: resource).new
|
|
116
|
+
@serializer || serializer_class_for(resource: resource).new
|
|
116
117
|
end
|
|
117
118
|
|
|
118
119
|
def serializer_class_for(resource:)
|
|
@@ -21,7 +21,15 @@ module LedgerSync
|
|
|
21
21
|
define_method('valid?') { resource.valid? }
|
|
22
22
|
define_method('errors') { resource.errors }
|
|
23
23
|
define_method('to_hash') { hash }
|
|
24
|
+
define_method('class_name') { resource.class.name }
|
|
25
|
+
define_method('model_name') { resource.model_name }
|
|
26
|
+
define_method('to_key') { resource.to_key }
|
|
24
27
|
references.each do |args|
|
|
28
|
+
if args.type.instance_of?(LedgerSync::Serialization::Type::SerializerReferencesOneType) # rubocop:disable Layout/LineLength
|
|
29
|
+
define_method("#{args.hash_attribute}_id") do
|
|
30
|
+
resource.send("#{args.hash_attribute}_id")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
25
33
|
define_method(args.hash_attribute) do
|
|
26
34
|
Query.const_get(
|
|
27
35
|
args.type.class.to_s.split('::').last
|
|
@@ -44,6 +52,10 @@ module LedgerSync
|
|
|
44
52
|
id.present?
|
|
45
53
|
end
|
|
46
54
|
|
|
55
|
+
def to_model
|
|
56
|
+
self
|
|
57
|
+
end
|
|
58
|
+
|
|
47
59
|
def to_json(*args)
|
|
48
60
|
JSON.generate(to_hash, *args)
|
|
49
61
|
end
|
|
@@ -53,9 +65,13 @@ module LedgerSync
|
|
|
53
65
|
class_name = name.pop.gsub(/[^0-9a-z ]/i, '').gsub(/.*\KSerializer/, '')
|
|
54
66
|
struct_name = "#{class_name}Struct"
|
|
55
67
|
module_name = name.empty? ? Object : Object.const_get(name.join('::'))
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
begin
|
|
69
|
+
v, $VERBOSE = $VERBOSE, v
|
|
70
|
+
# module_name.remove_const(struct_name) if module_name.const_defined?(struct_name)
|
|
71
|
+
module_name.const_set(struct_name, Class.new(OpenStruct))
|
|
72
|
+
ensure
|
|
73
|
+
$VERBOSE = v
|
|
74
|
+
end
|
|
59
75
|
klass.with_lazy_references(
|
|
60
76
|
hash,
|
|
61
77
|
struct_class: module_name.const_get(struct_name),
|
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.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jozef Vaclavik
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ledger_sync
|
|
@@ -109,7 +109,7 @@ metadata:
|
|
|
109
109
|
homepage_uri: https://engineering.dropbot.sh
|
|
110
110
|
source_code_uri: https://github.com/sandbite/ledger_sync-domains
|
|
111
111
|
changelog_uri: https://github.com/sandbite/ledger_sync-domains/blob/main/CHANGELOG.md
|
|
112
|
-
post_install_message:
|
|
112
|
+
post_install_message:
|
|
113
113
|
rdoc_options: []
|
|
114
114
|
require_paths:
|
|
115
115
|
- lib
|
|
@@ -124,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
125
|
version: '0'
|
|
126
126
|
requirements: []
|
|
127
|
-
rubygems_version: 3.
|
|
128
|
-
signing_key:
|
|
127
|
+
rubygems_version: 3.3.3
|
|
128
|
+
signing_key:
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: LedgerSync for Domains/Engines
|
|
131
131
|
test_files: []
|