table_sync 1.13.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/table_sync/orm_adapter/sequel.rb +8 -11
- data/lib/table_sync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839b04ca1021ff94b95f937236437c624efd6bcb63c129b23ec1d60b33ee841a
|
4
|
+
data.tar.gz: 536a8c08cf0860716afc5c67b3fb7915db971b9fd4af8d94de0fd092fe7d093f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11aa7c9d34b15a3798f9ab80704b873629be9ddadcf8fdd9ae61b74621dac19eecedede6fa5b360875253ce2f2cbf36b674d61fa1e76fd0cab107adf40a5323f
|
7
|
+
data.tar.gz: 358848e41f3ff97c5ce59d9e4bb0e578a26cd346afddf2fc22c0ff1dcc29204c18905b632ead7f2155b0ed6105e346f5e6dcef4e91ec7e32d4daa45bc89e8fbe
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [
|
4
|
+
## [2.0.0] - 2020-04-06
|
5
|
+
### Changed
|
6
|
+
- Sequel publishing hooks: checking for `:destroy` events inside `:if`/`:unless` predicates
|
7
|
+
|
8
|
+
## [1.13.1] - 2020-03-24
|
5
9
|
### Fixed
|
6
10
|
- **TableSync::BatchPublisher**: incorrect `attrs_for_metadata` definition (typo in method name);
|
7
11
|
|
@@ -40,24 +40,21 @@ module TableSync::ORMAdapter
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def register_callbacks(klass, if_predicate, unless_predicate, debounce_time)
|
43
|
-
{ create: :created, update: :updated }.each do |event, state|
|
43
|
+
{ create: :created, update: :updated, destroy: :destroyed }.each do |event, state|
|
44
44
|
klass.send(:define_method, :"after_#{event}") do
|
45
45
|
if instance_eval(&if_predicate) && !instance_eval(&unless_predicate)
|
46
46
|
db.after_commit do
|
47
|
-
TableSync::Publisher.new(
|
48
|
-
|
47
|
+
TableSync::Publisher.new(
|
48
|
+
self.class.name,
|
49
|
+
values,
|
50
|
+
state: state,
|
51
|
+
debounce_time: debounce_time,
|
52
|
+
).publish
|
49
53
|
end
|
50
54
|
end
|
51
|
-
super()
|
52
|
-
end
|
53
|
-
end
|
54
55
|
|
55
|
-
|
56
|
-
# publish anyway
|
57
|
-
db.after_commit do
|
58
|
-
TableSync::Publisher.new(self.class.name, values, state: :destroyed).publish
|
56
|
+
super()
|
59
57
|
end
|
60
|
-
super()
|
61
58
|
end
|
62
59
|
end
|
63
60
|
end
|
data/lib/table_sync/version.rb
CHANGED
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umbrellio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: memery
|