table_sync 6.1.0 → 6.6.1

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: 10bb9ae0cf3986bb7feba1c61403b8d459a7bc8efc3dc3bcbf3db47306efee5e
4
- data.tar.gz: 1d3d5b855d79efb73e2816ac617b8b73c1a85cc2a3e0cb9b2f975f07c86e0de3
3
+ metadata.gz: cae47295c6b798e4c669cfeaa34366fb92c4d843a69bbb35b3f2ffb43423a014
4
+ data.tar.gz: fd233855c36684a20dfe7087fec56f018e1192b0c5850521a0b70b6e78256657
5
5
  SHA512:
6
- metadata.gz: f569ca939a161a9e1a17f998066cbdf86483b28f4742efd1fd614a33689cbe7e6aa5cadba85e973b271337cc3207e9535e1ddcb42949f53948d444121d107d32
7
- data.tar.gz: 78ab27afcdb65a1dd0baaafe8f83f5812822bb5cdf002b3b9b31c3619c6ccc74d331e130f2170aa1d9063e36c88c05e24c8f8dc8dbeb2d08241a90cdd4a85603
6
+ metadata.gz: bd5f9c538a3470a8cca2362aa0e1cbda8b35d1f1b464d7f92f30dac2b4277ff6b736691b7fbebac7304e32c4075a0e8623601a9d8cbe7da4e4ff1b614b5d9e64
7
+ data.tar.gz: 0b763134f33803a4fc46738968150cf44adffaebb134e327aec225abe6ceda9eafcc3002eb5fe15a646b0903f684eb842ac1015dba2a525806e873e0354cb5e6
@@ -30,7 +30,7 @@ jobs:
30
30
  strategy:
31
31
  fail-fast: false
32
32
  matrix:
33
- ruby: ["2.7", "3.0", "3.1"]
33
+ ruby: ["3.1", "3.2", "3.3"]
34
34
 
35
35
  name: ${{ matrix.ruby }}
36
36
 
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  rubocop-config-umbrellio: lib/rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.7
5
+ TargetRubyVersion: 3.1
6
6
  Include:
7
7
  - bin/*
8
8
  - lib/**/*.rb
@@ -46,3 +46,9 @@ Style/OpenStructUse:
46
46
 
47
47
  RSpec/PendingWithoutReason:
48
48
  Enabled: false # Many false positives
49
+
50
+ RSpec/SkipBlockInsideExample:
51
+ Enabled: false # Many false positives
52
+
53
+ RSpec/IndexedLet:
54
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,6 +1,57 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [6.6.1] - 2025-01-30
5
+ ### Fixed
6
+ - Delete table_name and schema_name as required for TableSync::Publishing::Raw
7
+ - Delete table and schema as required for TableSync::Instrument#notify
8
+
9
+ ## [6.6.0] - 2024-12-06
10
+ ### Added
11
+ - Add custom version attributes
12
+ - Set table_name and schema_name as required for TableSync::Publishing::Raw
13
+
14
+ ### Changed
15
+ - `rabbit_messaging` gem version is locked on `~> 1.1.0` in order to provide a way to keep "up-to-date"
16
+ the actual rabbit_messaging gem version on our projects with table_sync update;
17
+
18
+ ### Removed
19
+ - Remove ruby 3.0 from ci workflow
20
+
21
+ ## [6.5.0] - 2024-03-19
22
+ ### Added
23
+ - Add ruby 3.3 to ci workflow
24
+
25
+ ### Changed
26
+ - Add expiration time for cache used in debouncing sync
27
+ - Update dependencies
28
+ - Fix rubocop issue
29
+ - Drop ruby 2.7 support
30
+
31
+ ### Removed
32
+ - Remove ruby 2.7 from ci workflow
33
+
34
+ ## [6.4.2] - 2023-11-14
35
+ ### Added
36
+ - Required fields allow accepting empty collections.
37
+
38
+ ## [6.4.1] - 2023-08-15
39
+ ### Added
40
+ - Required fields validation for the Raw and Batch publishers.
41
+
42
+ ## [6.4.0] - 2023-08-15
43
+ ### Changed
44
+ - Fix sort in receiving (#79).
45
+
46
+ ## [6.3.0] - 2023-07-24
47
+ ### Changed
48
+ - Send all original attributes for `delete` events instead of just PK.
49
+
50
+ ## [6.2.0] - 2023-06-29
51
+ ### Changed
52
+ - `rabbit_messaging` gem version is locked on `~> 0.13` in order to provide a way to keep "up-to-date"
53
+ the actual rabbit_messaging gem version on our projects with table_sync update;
54
+
4
55
  ## [6.1.0] - 2022-11-24
5
56
  ### Changed
6
57
 
data/Gemfile CHANGED
@@ -3,3 +3,19 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
+
7
+ gem "rspec"
8
+ gem "rubocop-config-umbrellio"
9
+ gem "simplecov"
10
+ gem "simplecov-lcov"
11
+
12
+ gem "activejob"
13
+ gem "activerecord"
14
+ gem "pg"
15
+ gem "sequel"
16
+ gem "timecop"
17
+
18
+ gem "bundler"
19
+ gem "bundler-audit"
20
+ gem "pry"
21
+ gem "rake"
data/Gemfile.lock CHANGED
@@ -1,232 +1,282 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_sync (6.1.0)
4
+ table_sync (6.6.1)
5
5
  memery
6
- rabbit_messaging
6
+ rabbit_messaging (>= 1.1.0)
7
7
  rails
8
8
  self_data
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (7.0.4.2)
14
- actionpack (= 7.0.4.2)
15
- activesupport (= 7.0.4.2)
13
+ actioncable (7.1.5.1)
14
+ actionpack (= 7.1.5.1)
15
+ activesupport (= 7.1.5.1)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
- actionmailbox (7.0.4.2)
19
- actionpack (= 7.0.4.2)
20
- activejob (= 7.0.4.2)
21
- activerecord (= 7.0.4.2)
22
- activestorage (= 7.0.4.2)
23
- activesupport (= 7.0.4.2)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (7.1.5.1)
20
+ actionpack (= 7.1.5.1)
21
+ activejob (= 7.1.5.1)
22
+ activerecord (= 7.1.5.1)
23
+ activestorage (= 7.1.5.1)
24
+ activesupport (= 7.1.5.1)
24
25
  mail (>= 2.7.1)
25
26
  net-imap
26
27
  net-pop
27
28
  net-smtp
28
- actionmailer (7.0.4.2)
29
- actionpack (= 7.0.4.2)
30
- actionview (= 7.0.4.2)
31
- activejob (= 7.0.4.2)
32
- activesupport (= 7.0.4.2)
29
+ actionmailer (7.1.5.1)
30
+ actionpack (= 7.1.5.1)
31
+ actionview (= 7.1.5.1)
32
+ activejob (= 7.1.5.1)
33
+ activesupport (= 7.1.5.1)
33
34
  mail (~> 2.5, >= 2.5.4)
34
35
  net-imap
35
36
  net-pop
36
37
  net-smtp
37
- rails-dom-testing (~> 2.0)
38
- actionpack (7.0.4.2)
39
- actionview (= 7.0.4.2)
40
- activesupport (= 7.0.4.2)
41
- rack (~> 2.0, >= 2.2.0)
38
+ rails-dom-testing (~> 2.2)
39
+ actionpack (7.1.5.1)
40
+ actionview (= 7.1.5.1)
41
+ activesupport (= 7.1.5.1)
42
+ nokogiri (>= 1.8.5)
43
+ racc
44
+ rack (>= 2.2.4)
45
+ rack-session (>= 1.0.1)
42
46
  rack-test (>= 0.6.3)
43
- rails-dom-testing (~> 2.0)
44
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
45
- actiontext (7.0.4.2)
46
- actionpack (= 7.0.4.2)
47
- activerecord (= 7.0.4.2)
48
- activestorage (= 7.0.4.2)
49
- activesupport (= 7.0.4.2)
47
+ rails-dom-testing (~> 2.2)
48
+ rails-html-sanitizer (~> 1.6)
49
+ actiontext (7.1.5.1)
50
+ actionpack (= 7.1.5.1)
51
+ activerecord (= 7.1.5.1)
52
+ activestorage (= 7.1.5.1)
53
+ activesupport (= 7.1.5.1)
50
54
  globalid (>= 0.6.0)
51
55
  nokogiri (>= 1.8.5)
52
- actionview (7.0.4.2)
53
- activesupport (= 7.0.4.2)
56
+ actionview (7.1.5.1)
57
+ activesupport (= 7.1.5.1)
54
58
  builder (~> 3.1)
55
- erubi (~> 1.4)
56
- rails-dom-testing (~> 2.0)
57
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
58
- activejob (7.0.4.2)
59
- activesupport (= 7.0.4.2)
59
+ erubi (~> 1.11)
60
+ rails-dom-testing (~> 2.2)
61
+ rails-html-sanitizer (~> 1.6)
62
+ activejob (7.1.5.1)
63
+ activesupport (= 7.1.5.1)
60
64
  globalid (>= 0.3.6)
61
- activemodel (7.0.4.2)
62
- activesupport (= 7.0.4.2)
63
- activerecord (7.0.4.2)
64
- activemodel (= 7.0.4.2)
65
- activesupport (= 7.0.4.2)
66
- activestorage (7.0.4.2)
67
- actionpack (= 7.0.4.2)
68
- activejob (= 7.0.4.2)
69
- activerecord (= 7.0.4.2)
70
- activesupport (= 7.0.4.2)
65
+ activemodel (7.1.5.1)
66
+ activesupport (= 7.1.5.1)
67
+ activerecord (7.1.5.1)
68
+ activemodel (= 7.1.5.1)
69
+ activesupport (= 7.1.5.1)
70
+ timeout (>= 0.4.0)
71
+ activestorage (7.1.5.1)
72
+ actionpack (= 7.1.5.1)
73
+ activejob (= 7.1.5.1)
74
+ activerecord (= 7.1.5.1)
75
+ activesupport (= 7.1.5.1)
71
76
  marcel (~> 1.0)
72
- mini_mime (>= 1.1.0)
73
- activesupport (7.0.4.2)
77
+ activesupport (7.1.5.1)
78
+ base64
79
+ benchmark (>= 0.3)
80
+ bigdecimal
74
81
  concurrent-ruby (~> 1.0, >= 1.0.2)
82
+ connection_pool (>= 2.2.5)
83
+ drb
75
84
  i18n (>= 1.6, < 2)
85
+ logger (>= 1.4.2)
76
86
  minitest (>= 5.1)
87
+ mutex_m
88
+ securerandom (>= 0.3)
77
89
  tzinfo (~> 2.0)
78
90
  amq-protocol (2.3.2)
79
91
  ast (2.4.2)
80
- builder (3.2.4)
92
+ base64 (0.2.0)
93
+ benchmark (0.4.0)
94
+ bigdecimal (3.1.8)
95
+ builder (3.3.0)
81
96
  bundler-audit (0.9.1)
82
97
  bundler (>= 1.2.0, < 3)
83
98
  thor (~> 1.0)
84
- bunny (2.20.3)
99
+ bunny (2.23.0)
85
100
  amq-protocol (~> 2.3, >= 2.3.1)
86
101
  sorted_set (~> 1, >= 1.0.2)
87
102
  coderay (1.1.3)
88
- concurrent-ruby (1.2.0)
103
+ concurrent-ruby (1.3.4)
104
+ connection_pool (2.4.1)
89
105
  crass (1.0.6)
90
- date (3.3.3)
106
+ date (3.4.1)
91
107
  diff-lcs (1.5.0)
92
108
  docile (1.4.0)
93
- erubi (1.12.0)
94
- globalid (1.1.0)
95
- activesupport (>= 5.0)
96
- i18n (1.12.0)
109
+ drb (2.2.1)
110
+ erubi (1.13.0)
111
+ globalid (1.2.1)
112
+ activesupport (>= 6.1)
113
+ i18n (1.14.6)
97
114
  concurrent-ruby (~> 1.0)
115
+ io-console (0.8.0)
116
+ irb (1.14.2)
117
+ rdoc (>= 4.0.0)
118
+ reline (>= 0.4.2)
98
119
  json (2.6.3)
99
- lamian (1.7.0)
120
+ kicks (3.1.1)
121
+ bunny (~> 2.19)
122
+ concurrent-ruby (~> 1.0)
123
+ rake (>= 12.3, < 14.0)
124
+ serverengine (~> 2.1)
125
+ thor
126
+ lamian (1.10.0)
100
127
  rails (>= 4.2)
101
- loofah (2.19.1)
128
+ logger (1.6.3)
129
+ loofah (2.23.1)
102
130
  crass (~> 1.0.2)
103
- nokogiri (>= 1.5.9)
131
+ nokogiri (>= 1.12.0)
104
132
  mail (2.8.1)
105
133
  mini_mime (>= 0.1.1)
106
134
  net-imap
107
135
  net-pop
108
136
  net-smtp
109
- marcel (1.0.2)
110
- memery (1.4.1)
137
+ marcel (1.0.4)
138
+ memery (1.5.0)
111
139
  ruby2_keywords (~> 0.0.2)
112
- method_source (1.0.0)
113
- mini_mime (1.1.2)
114
- mini_portile2 (2.8.1)
115
- minitest (5.17.0)
116
- net-imap (0.3.4)
140
+ method_source (1.1.0)
141
+ mini_mime (1.1.5)
142
+ mini_portile2 (2.8.8)
143
+ minitest (5.25.4)
144
+ mutex_m (0.3.0)
145
+ net-imap (0.5.2)
117
146
  date
118
147
  net-protocol
119
148
  net-pop (0.1.2)
120
149
  net-protocol
121
- net-protocol (0.2.1)
150
+ net-protocol (0.2.2)
122
151
  timeout
123
- net-smtp (0.3.3)
152
+ net-smtp (0.5.0)
124
153
  net-protocol
125
- nio4r (2.5.8)
126
- nokogiri (1.14.2)
127
- mini_portile2 (~> 2.8.0)
154
+ nio4r (2.7.4)
155
+ nokogiri (1.17.2)
156
+ mini_portile2 (~> 2.8.2)
128
157
  racc (~> 1.4)
129
- parallel (1.22.1)
130
- parser (3.2.1.0)
158
+ parallel (1.23.0)
159
+ parser (3.2.2.3)
131
160
  ast (~> 2.4.1)
132
- pg (1.4.5)
161
+ racc
162
+ pg (1.5.3)
133
163
  pry (0.14.2)
134
164
  coderay (~> 1.1)
135
165
  method_source (~> 1.0)
136
- rabbit_messaging (0.12.1)
166
+ psych (5.2.1)
167
+ date
168
+ stringio
169
+ rabbit_messaging (1.1.0)
137
170
  bunny (~> 2.0)
171
+ kicks (~> 3)
138
172
  lamian
139
- rails (>= 5.2)
140
- sneakers (~> 2.0)
173
+ rails (>= 6.1)
141
174
  tainbox
142
- racc (1.6.2)
143
- rack (2.2.6.2)
144
- rack-test (2.0.2)
175
+ racc (1.8.1)
176
+ rack (3.1.8)
177
+ rack-session (2.0.0)
178
+ rack (>= 3.0.0)
179
+ rack-test (2.1.0)
145
180
  rack (>= 1.3)
146
- rails (7.0.4.2)
147
- actioncable (= 7.0.4.2)
148
- actionmailbox (= 7.0.4.2)
149
- actionmailer (= 7.0.4.2)
150
- actionpack (= 7.0.4.2)
151
- actiontext (= 7.0.4.2)
152
- actionview (= 7.0.4.2)
153
- activejob (= 7.0.4.2)
154
- activemodel (= 7.0.4.2)
155
- activerecord (= 7.0.4.2)
156
- activestorage (= 7.0.4.2)
157
- activesupport (= 7.0.4.2)
181
+ rackup (2.2.1)
182
+ rack (>= 3)
183
+ rails (7.1.5.1)
184
+ actioncable (= 7.1.5.1)
185
+ actionmailbox (= 7.1.5.1)
186
+ actionmailer (= 7.1.5.1)
187
+ actionpack (= 7.1.5.1)
188
+ actiontext (= 7.1.5.1)
189
+ actionview (= 7.1.5.1)
190
+ activejob (= 7.1.5.1)
191
+ activemodel (= 7.1.5.1)
192
+ activerecord (= 7.1.5.1)
193
+ activestorage (= 7.1.5.1)
194
+ activesupport (= 7.1.5.1)
158
195
  bundler (>= 1.15.0)
159
- railties (= 7.0.4.2)
160
- rails-dom-testing (2.0.3)
161
- activesupport (>= 4.2.0)
196
+ railties (= 7.1.5.1)
197
+ rails-dom-testing (2.2.0)
198
+ activesupport (>= 5.0.0)
199
+ minitest
162
200
  nokogiri (>= 1.6)
163
- rails-html-sanitizer (1.5.0)
164
- loofah (~> 2.19, >= 2.19.1)
165
- railties (7.0.4.2)
166
- actionpack (= 7.0.4.2)
167
- activesupport (= 7.0.4.2)
168
- method_source
201
+ rails-html-sanitizer (1.6.2)
202
+ loofah (~> 2.21)
203
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
204
+ railties (7.1.5.1)
205
+ actionpack (= 7.1.5.1)
206
+ activesupport (= 7.1.5.1)
207
+ irb
208
+ rackup (>= 1.0.0)
169
209
  rake (>= 12.2)
170
- thor (~> 1.0)
171
- zeitwerk (~> 2.5)
210
+ thor (~> 1.0, >= 1.2.2)
211
+ zeitwerk (~> 2.6)
172
212
  rainbow (3.1.1)
173
- rake (13.0.6)
213
+ rake (13.2.1)
174
214
  rbtree (0.4.6)
175
- regexp_parser (2.7.0)
176
- rexml (3.2.5)
215
+ rdoc (6.9.1)
216
+ psych (>= 4.0.0)
217
+ regexp_parser (2.8.1)
218
+ reline (0.6.0)
219
+ io-console (~> 0.5)
220
+ rexml (3.3.9)
177
221
  rspec (3.12.0)
178
222
  rspec-core (~> 3.12.0)
179
223
  rspec-expectations (~> 3.12.0)
180
224
  rspec-mocks (~> 3.12.0)
181
- rspec-core (3.12.1)
225
+ rspec-core (3.12.2)
182
226
  rspec-support (~> 3.12.0)
183
- rspec-expectations (3.12.2)
227
+ rspec-expectations (3.12.3)
184
228
  diff-lcs (>= 1.2.0, < 2.0)
185
229
  rspec-support (~> 3.12.0)
186
- rspec-mocks (3.12.3)
230
+ rspec-mocks (3.12.6)
187
231
  diff-lcs (>= 1.2.0, < 2.0)
188
232
  rspec-support (~> 3.12.0)
189
- rspec-support (3.12.0)
190
- rubocop (1.43.0)
233
+ rspec-support (3.12.1)
234
+ rubocop (1.50.2)
191
235
  json (~> 2.3)
192
236
  parallel (~> 1.10)
193
237
  parser (>= 3.2.0.0)
194
238
  rainbow (>= 2.2.2, < 4.0)
195
239
  regexp_parser (>= 1.8, < 3.0)
196
240
  rexml (>= 3.2.5, < 4.0)
197
- rubocop-ast (>= 1.24.1, < 2.0)
241
+ rubocop-ast (>= 1.28.0, < 2.0)
198
242
  ruby-progressbar (~> 1.7)
199
243
  unicode-display_width (>= 2.4.0, < 3.0)
200
- rubocop-ast (1.26.0)
244
+ rubocop-ast (1.29.0)
201
245
  parser (>= 3.2.1.0)
202
- rubocop-config-umbrellio (1.43.0.81)
203
- rubocop (~> 1.43.0)
204
- rubocop-performance (~> 1.15.0)
205
- rubocop-rails (~> 2.17.0)
246
+ rubocop-capybara (2.18.0)
247
+ rubocop (~> 1.41)
248
+ rubocop-config-umbrellio (1.50.0.85)
249
+ rubocop (~> 1.50.0)
250
+ rubocop-performance (~> 1.17.0)
251
+ rubocop-rails (~> 2.19.0)
206
252
  rubocop-rake (~> 0.6.0)
207
- rubocop-rspec (~> 2.16.0)
253
+ rubocop-rspec (~> 2.20.0)
208
254
  rubocop-sequel (~> 0.3.3)
209
- rubocop-performance (1.15.2)
255
+ rubocop-performance (1.17.1)
210
256
  rubocop (>= 1.7.0, < 2.0)
211
257
  rubocop-ast (>= 0.4.0)
212
- rubocop-rails (2.17.4)
258
+ rubocop-rails (2.19.1)
213
259
  activesupport (>= 4.2.0)
214
260
  rack (>= 1.1)
215
261
  rubocop (>= 1.33.0, < 2.0)
216
262
  rubocop-rake (0.6.0)
217
263
  rubocop (~> 1.0)
218
- rubocop-rspec (2.16.0)
264
+ rubocop-rspec (2.20.0)
219
265
  rubocop (~> 1.33)
266
+ rubocop-capybara (~> 2.17)
220
267
  rubocop-sequel (0.3.4)
221
268
  rubocop (~> 1.0)
222
- ruby-progressbar (1.11.0)
269
+ ruby-progressbar (1.13.0)
223
270
  ruby2_keywords (0.0.5)
271
+ securerandom (0.4.1)
224
272
  self_data (1.3.0)
225
- sequel (5.65.0)
226
- serverengine (2.0.7)
273
+ sequel (5.71.0)
274
+ serverengine (2.4.0)
275
+ base64 (~> 0.1)
276
+ logger (~> 1.4)
227
277
  sigdump (~> 0.2.2)
228
- set (1.0.3)
229
- sigdump (0.2.4)
278
+ set (1.1.1)
279
+ sigdump (0.2.5)
230
280
  simplecov (0.22.0)
231
281
  docile (~> 1.1)
232
282
  simplecov-html (~> 0.11)
@@ -234,27 +284,22 @@ GEM
234
284
  simplecov-html (0.12.3)
235
285
  simplecov-lcov (0.8.0)
236
286
  simplecov_json_formatter (0.1.4)
237
- sneakers (2.11.0)
238
- bunny (~> 2.12)
239
- concurrent-ruby (~> 1.0)
240
- rake
241
- serverengine (~> 2.0.5)
242
- thor
243
287
  sorted_set (1.0.3)
244
288
  rbtree
245
289
  set (~> 1.0)
290
+ stringio (3.1.2)
246
291
  tainbox (2.1.2)
247
292
  activesupport
248
- thor (1.2.1)
249
- timecop (0.9.6)
250
- timeout (0.3.1)
293
+ thor (1.3.2)
294
+ timecop (0.9.7)
295
+ timeout (0.4.3)
251
296
  tzinfo (2.0.6)
252
297
  concurrent-ruby (~> 1.0)
253
298
  unicode-display_width (2.4.2)
254
- websocket-driver (0.7.5)
299
+ websocket-driver (0.7.6)
255
300
  websocket-extensions (>= 0.1.0)
256
301
  websocket-extensions (0.1.5)
257
- zeitwerk (2.6.7)
302
+ zeitwerk (2.6.18)
258
303
 
259
304
  PLATFORMS
260
305
  ruby
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSync::Instrument
4
- NOTIFIER_REQUIRED_ARGS = %i[table schema event count direction].freeze
4
+ NOTIFIER_REQUIRED_ARGS = %i[event count direction].freeze
5
5
 
6
6
  extend self
7
7
 
@@ -6,11 +6,11 @@ module TableSync::InstrumentAdapter
6
6
 
7
7
  def notify(table:, schema:, event:, direction:, count: 1)
8
8
  ::ActiveSupport::Notifications.instrument "tablesync.#{direction}.#{event}",
9
- count: count,
9
+ count:,
10
10
  table: table.to_s,
11
11
  schema: schema.to_s,
12
- event: event,
13
- direction: direction
12
+ event:,
13
+ direction:
14
14
  end
15
15
  end
16
16
  end
@@ -53,7 +53,7 @@ module TableSync::ORMAdapter
53
53
  if object.respond_to?(:attributes_for_destroy)
54
54
  object.attributes_for_destroy
55
55
  else
56
- needle
56
+ attributes
57
57
  end
58
58
  end
59
59
 
@@ -2,15 +2,18 @@
2
2
 
3
3
  class TableSync::Publishing::Batch
4
4
  include Tainbox
5
+ include TableSync::Utils::RequiredValidator
5
6
 
6
7
  attribute :object_class
7
8
  attribute :original_attributes
8
-
9
+ attribute :custom_version
9
10
  attribute :routing_key
10
11
  attribute :headers
11
12
 
12
13
  attribute :event, default: :update
13
14
 
15
+ require_attributes :object_class, :original_attributes
16
+
14
17
  def publish_later
15
18
  job.perform_later(job_attributes)
16
19
  end
@@ -2,18 +2,19 @@
2
2
 
3
3
  module TableSync::Publishing::Data
4
4
  class Objects
5
- attr_reader :objects, :event
5
+ attr_reader :objects, :event, :custom_version
6
6
 
7
- def initialize(objects:, event:)
8
- @objects = objects
9
- @event = TableSync::Event.new(event)
7
+ def initialize(objects:, event:, custom_version:)
8
+ @objects = objects
9
+ @event = TableSync::Event.new(event)
10
+ @custom_version = custom_version
10
11
  end
11
12
 
12
13
  def construct
13
14
  {
14
- model: model,
15
+ model:,
15
16
  attributes: attributes_for_sync,
16
- version: version,
17
+ version: custom_version || version,
17
18
  event: event.resolve,
18
19
  metadata: event.metadata,
19
20
  }
@@ -2,19 +2,20 @@
2
2
 
3
3
  module TableSync::Publishing::Data
4
4
  class Raw
5
- attr_reader :model_name, :attributes_for_sync, :event
5
+ attr_reader :model_name, :attributes_for_sync, :event, :custom_version
6
6
 
7
- def initialize(model_name:, attributes_for_sync:, event:)
7
+ def initialize(model_name:, attributes_for_sync:, event:, custom_version:)
8
8
  @model_name = model_name
9
9
  @attributes_for_sync = attributes_for_sync
10
10
  @event = TableSync::Event.new(event)
11
+ @custom_version = custom_version
11
12
  end
12
13
 
13
14
  def construct
14
15
  {
15
16
  model: model_name,
16
17
  attributes: wrapped_attributes_for_sync,
17
- version: version,
18
+ version: custom_version || version,
18
19
  event: event.resolve,
19
20
  metadata: event.metadata,
20
21
  }