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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dbfc8cab971d182bff7e688066f3020406b378176c2f8ab40e62f79cf2e3c3e
4
- data.tar.gz: 6701e7abc6b3ea3de0999e08f2c5cc20c65c42ae7b14bf5098511db23a71094f
3
+ metadata.gz: 839b04ca1021ff94b95f937236437c624efd6bcb63c129b23ec1d60b33ee841a
4
+ data.tar.gz: 536a8c08cf0860716afc5c67b3fb7915db971b9fd4af8d94de0fd092fe7d093f
5
5
  SHA512:
6
- metadata.gz: b88bc1cac782a00158289fd6bb7895a8e58b5bb589c9f07d4ac970b79f0798ae84830904a12ce39516b237780ac615b2bf6cb2e2c519e1769182ae7ac7ed7920
7
- data.tar.gz: be89f2b6e4360021b269c9b9c858c89c857007bd147a429cc880e71aebd8c7cbe0a054c84ad6a3b816b375759e7957137b2f8b46cb77c21141e1ad4ede0b9ab7
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
- ## [1.13.1] - 2019-03-24
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(self.class.name, values,
48
- state: state, debounce_time: debounce_time).publish
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
- klass.send(:define_method, :after_destroy) do
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableSync
4
- VERSION = "1.13.1"
4
+ VERSION = "2.0.0"
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: 1.13.1
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-03-24 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery