dato 0.7.0 → 0.7.1

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: 5ae6a3e8219a9628772a2f4da2bdd5b8024042c765d6ea1582b94c2f86c59f81
4
- data.tar.gz: 8d56caeecb617c3eda4072c9ff649e596fe4968c1b64b46c639804f23222fbd7
3
+ metadata.gz: 72cf7ee954d8a8d7cd830e96740e32cb6aa2bf3de95d6d665dcc9d59956313f4
4
+ data.tar.gz: df97ce29199800559fcfef471a70e76cb75bc50d84175d55c9db35f8d53e685e
5
5
  SHA512:
6
- metadata.gz: 45fd8ebe07494123845f26eac19162a9c3a53f435607812ff0fa336567993171b73cd4f703d9f1b52f41c9c3758a366788bfde944a18f7aa92e762f8250426d4
7
- data.tar.gz: 7078abd9cd150a79ca7d264094ef60321574fb4763020e5c473de9530c6e5c285d885ce792d6eea4f522b5a63f360c240c1dd0b3942f309df2912c74a8944ee0
6
+ metadata.gz: 8605bfa3d4c080d249c13958e48fce6b39ecdf632269d8786b8c10767dc6f1ef53434b82bac04b2ef922a9fe6ddebda56848bb75387c7fb825c7fbf300d91a8a
7
+ data.tar.gz: 2f0db7c66bfd1c84f0a93a6fdecdaaf5289401b92cef4644a2ee722e863866c40a3fe45337298e4adb1af342e2551173b1e3fd08535d178c74d8efde500d4ac2
@@ -45,6 +45,7 @@ module Dato
45
45
 
46
46
  pusher.subscribe("private-site-#{site_id}")
47
47
 
48
+ bind_on_site_upsert(&block)
48
49
  bind_on_item_destroy(&block)
49
50
  bind_on_item_upsert(&block)
50
51
  bind_on_item_type_upsert(&block)
@@ -61,6 +62,22 @@ module Dato
61
62
 
62
63
  private
63
64
 
65
+ def bind_on_site_upsert(&block)
66
+ bind_on("site:upsert", block) do |data|
67
+ threads = [
68
+ Thread.new { Thread.current[:output] = site },
69
+ Thread.new { Thread.current[:output] = all_items }
70
+ ]
71
+
72
+ results = threads.map do |t|
73
+ t.join
74
+ t[:output]
75
+ end
76
+
77
+ @entities_repo = EntitiesRepo.new(*results)
78
+ end
79
+ end
80
+
64
81
  def bind_on_item_upsert(&block)
65
82
  event_type = preview_mode ? 'preview_mode' : 'published_mode'
66
83
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dato
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler