avromatic 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/avromatic/railtie.rb +12 -1
- data/lib/avromatic/version.rb +1 -1
- data/lib/avromatic.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9b086516351e441fda56c4bd8ba092e94d21138
|
4
|
+
data.tar.gz: 620bfdfab8da77dd66a817cdf5735aafd6e923d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dde2fdc32aa7b2e9c133ff38e955900ea60a53d484e001488c8d5cc96baf2a767a0ec2776b0992290215eb896e408b8809f5cef1bc727daa9611e45bd7740a6
|
7
|
+
data.tar.gz: 51a66b71eda6f2e16175c6d92875ffc3a7ed43e8195987db913bee3e2e98b1ecba51e4848e682f2c14a93414e8566a3ce806684b7aca2900a225ef4beb98dfc2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# avromatic changelog
|
2
2
|
|
3
|
+
## v0.11.1
|
4
|
+
- Another fix for Rails initialization and reloading. Do not clear the nested
|
5
|
+
models registry the first time that the `to_prepare` hook is called.
|
6
|
+
|
3
7
|
## v0.11.0
|
4
8
|
- Replace `Avromatic.on_initialize` proc with `Avromatic.eager_load_models`
|
5
9
|
array. The models listed by this configuration are added to the registry
|
data/lib/avromatic/railtie.rb
CHANGED
@@ -5,8 +5,19 @@ module Avromatic
|
|
5
5
|
config.logger = Rails.logger
|
6
6
|
end
|
7
7
|
|
8
|
+
# Rails calls the to_prepare hook once during boot-up, after running
|
9
|
+
# initializers. After the to_prepare call during boot-up, no code will
|
10
|
+
# we reloaded, so we need to retain the contents of the nested_models
|
11
|
+
# registry.
|
12
|
+
#
|
13
|
+
# For subsequent calls to to_prepare (in development), the nested_models
|
14
|
+
# registry is cleared and repopulated by explicitly referencing the
|
15
|
+
# eager_loaded_models.
|
16
|
+
first_prepare = true
|
17
|
+
|
8
18
|
Rails.configuration.to_prepare do
|
9
|
-
Avromatic.prepare!
|
19
|
+
Avromatic.prepare!(skip_clear: first_prepare)
|
20
|
+
first_prepare = false
|
10
21
|
end
|
11
22
|
end
|
12
23
|
end
|
data/lib/avromatic/version.rb
CHANGED
data/lib/avromatic.rb
CHANGED
@@ -42,10 +42,11 @@ module Avromatic
|
|
42
42
|
self.messaging = build_messaging
|
43
43
|
end
|
44
44
|
|
45
|
-
# This method is called as a Rails to_prepare
|
46
|
-
# first initializes and prior to each code reloading.
|
47
|
-
|
48
|
-
|
45
|
+
# This method is called as a Rails to_prepare hook after the application
|
46
|
+
# first initializes during boot-up and prior to each code reloading.
|
47
|
+
# For the first call during boot-up we do not want to clear the nested_models.
|
48
|
+
def self.prepare!(skip_clear: false)
|
49
|
+
nested_models.clear unless skip_clear
|
49
50
|
eager_load_models!
|
50
51
|
end
|
51
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avromatic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|