table_sync 6.0 → 6.0.2

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: 7854c781cde972c7dc2d12266f5c9f302e4a9a6b2ae4cfea8215c13bfb9dc326
4
- data.tar.gz: dd87d2bc24ec62be162375352cd4f18fa1e0363f80cae49295dc2448d6c97aba
3
+ metadata.gz: 41a5d020905434bea4c5a4e1a53a2bb1125a86a9335491202706b2bf64e9a938
4
+ data.tar.gz: 9db8c23e9f26770a87f6952ebfb982e22b06e6abdf48a54ecf162f50dbe89bfa
5
5
  SHA512:
6
- metadata.gz: 53d28d64907a36913b49a274246b096880be2be13767d639c9ed3e3e7951ba9595c1e548db4b09223ad41c0f36ef536b6ab13fd961ef2b11e2be1b769b12ce05
7
- data.tar.gz: cc562e11bfdb74e3049857c96d428222d2c039ebf3808651f741ce20bdc969f57aca8a883ee568e33d06206303b5b4f54b8d6e4ca91e285c0ff63388653dfb3f
6
+ metadata.gz: 845f2b56ba16fc606eec72a3f88dc021ea72a08918b255eb1fe11cd9a0b7150001c43073469ef8e1ad055b6f98c8d2c6aa30f8cf46836bc5f252543be9e71bce
7
+ data.tar.gz: 2665c600fc3961b32c860c121a48af09dbf53e4ddc0d7b8a76aade0d22003baef82df649c0d5e435c0e2ec992403913bb8cd131d6b5f5c9abb5f5309cfc4d0bb
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [6.0.2] - 2021-12-01
5
+ ### Fixed
6
+ - Fixed bug: skip publish when object is new and event is destroy for ActiveRecord
7
+
8
+ ## [6.0.1] - 2021-11-30
9
+ ### Fixed
10
+ - fixed docs
11
+
4
12
  ## [6.0.0] - 2021-10-15
5
13
  ### Added
6
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_sync (6.0)
4
+ table_sync (6.0.2)
5
5
  memery
6
6
  rabbit_messaging
7
7
  rails
@@ -91,7 +91,7 @@ GEM
91
91
  activesupport (>= 5.0)
92
92
  i18n (1.8.10)
93
93
  concurrent-ruby (~> 1.0)
94
- lamian (1.2.0)
94
+ lamian (1.4.0)
95
95
  rails (>= 4.2)
96
96
  loofah (2.12.0)
97
97
  crass (~> 1.0.2)
@@ -102,7 +102,7 @@ GEM
102
102
  memery (1.4.1)
103
103
  ruby2_keywords (~> 0.0.2)
104
104
  method_source (1.0.0)
105
- mini_mime (1.1.1)
105
+ mini_mime (1.1.2)
106
106
  mini_portile2 (2.6.1)
107
107
  minitest (5.14.4)
108
108
  nio4r (2.5.8)
@@ -123,7 +123,7 @@ GEM
123
123
  rails (>= 5.2)
124
124
  sneakers (~> 2.0)
125
125
  tainbox
126
- racc (1.5.2)
126
+ racc (1.6.0)
127
127
  rack (2.2.3)
128
128
  rack-test (1.1.0)
129
129
  rack (>= 1.0, < 3)
@@ -209,7 +209,7 @@ GEM
209
209
  sequel (5.43.0)
210
210
  serverengine (2.0.7)
211
211
  sigdump (~> 0.2.2)
212
- set (1.0.1)
212
+ set (1.0.2)
213
213
  sigdump (0.2.4)
214
214
  simplecov (0.21.2)
215
215
  docile (~> 1.1)
@@ -230,9 +230,9 @@ GEM
230
230
  sprockets (4.0.2)
231
231
  concurrent-ruby (~> 1.0)
232
232
  rack (> 1, < 3)
233
- sprockets-rails (3.2.2)
234
- actionpack (>= 4.0)
235
- activesupport (>= 4.0)
233
+ sprockets-rails (3.4.1)
234
+ actionpack (>= 5.2)
235
+ activesupport (>= 5.2)
236
236
  sprockets (>= 3.0.0)
237
237
  tainbox (2.1.2)
238
238
  activesupport
@@ -129,7 +129,7 @@ One possible way of using it is defining a headers exchange and routing rules ba
129
129
  Example:
130
130
 
131
131
  ```ruby
132
- TableSync.routing_metadata_callable = -> (klass, attributes) { attributes.slice("project_id") }
132
+ TableSync.headers_callable = -> (klass, attributes) { attributes.slice("project_id") }
133
133
  ```
134
134
 
135
135
  ## Other
data/docs/publishing.md CHANGED
@@ -41,6 +41,23 @@ class SomeOtherModel < Sequel::Model
41
41
  end
42
42
  ```
43
43
 
44
+ ### Non persisted record destruction
45
+
46
+ Sometimes destroy event can happen for non persisted record. In this case we can expect the following:
47
+
48
+ For Sequel: 'Sequel::NoExistingObject' is raised. (This is default Sequel behaviour)
49
+ For Active Record: Publishing is skipped.
50
+
51
+ Example:
52
+
53
+ ```ruby
54
+ # ActiveRecord
55
+ user = User.new.destroy! # Publishing is skipped.
56
+
57
+ # Sequel
58
+ user = User.new.destroy! # raise Sequel::NoExistingObject
59
+ ```
60
+
44
61
  ## Manual
45
62
 
46
63
  Directly call one of the publishers. It's the best if you need to sync a lot of data.
@@ -60,4 +77,4 @@ Example:
60
77
 
61
78
  - [Publishers](publishing/publishers.md)
62
79
  - [Configuration](publishing/configuration.md)
63
- - [Manual Sync (examples)](publishing/manual.md)
80
+ - [Manual Sync (examples)](publishing/manual.md)
@@ -8,6 +8,8 @@ module TableSync::Setup
8
8
  options = options_exposed_for_block
9
9
 
10
10
  object_class.after_commit(on: event) do
11
+ next if new_record? && destroyed?
12
+
11
13
  if instance_eval(&options[:if]) && !instance_eval(&options[:unless])
12
14
  TableSync::Publishing::Single.new(
13
15
  object_class: self.class.name,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSync
4
- VERSION = "6.0"
4
+ VERSION = "6.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: '6.0'
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Umbrellio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery