plutonium 0.53.0 → 0.53.1
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/plutonium/routing/route_set_extensions.rb +24 -7
- data/lib/plutonium/version.rb +1 -1
- data/package.json +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: 7470b409578e020a7a12c57bcce9df7d774795aaa4e4cad97cd2267861eeb8ba
|
|
4
|
+
data.tar.gz: 1baaad41e2a667896eb189e2875fbdc3099fd7e613755137e7afc851372ca00d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 672f79ac91915eab2127dc46baac52ec0b14052d161374160cb39b2261fae11618d68b01793c5caa596cbf0369880c811bbca7890e4ed15f327c50959985e35f
|
|
7
|
+
data.tar.gz: 0ff4f64b3833d6a3e6d573bf05553fa100361f4eada6f534eb0b67251fb988294b32a6bb93711dfdd93a238bdf3373094de8a58686eb6bf59d0de92c78adc89a
|
data/CHANGELOG.md
CHANGED
|
@@ -22,8 +22,11 @@ module Plutonium
|
|
|
22
22
|
#
|
|
23
23
|
# @return [void]
|
|
24
24
|
def clear!
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
if engine
|
|
26
|
+
resource_route_config_lookup.clear
|
|
27
|
+
engine.resource_register.clear
|
|
28
|
+
end
|
|
29
|
+
|
|
27
30
|
super
|
|
28
31
|
end
|
|
29
32
|
|
|
@@ -98,9 +101,14 @@ module Plutonium
|
|
|
98
101
|
|
|
99
102
|
# Returns the current engine for the routes.
|
|
100
103
|
#
|
|
101
|
-
#
|
|
104
|
+
# Memoizes via defined? so a nil result (non-Plutonium route set) is cached
|
|
105
|
+
# instead of being recomputed on every call.
|
|
106
|
+
#
|
|
107
|
+
# @return [Class, nil] The owning engine, or nil if not a Plutonium engine.
|
|
102
108
|
def engine
|
|
103
|
-
@engine
|
|
109
|
+
return @engine if defined?(@engine)
|
|
110
|
+
|
|
111
|
+
@engine = determine_engine
|
|
104
112
|
end
|
|
105
113
|
|
|
106
114
|
# @return [Hash] A lookup table for resource route configurations.
|
|
@@ -112,12 +120,21 @@ module Plutonium
|
|
|
112
120
|
|
|
113
121
|
private
|
|
114
122
|
|
|
115
|
-
# Determines the
|
|
123
|
+
# Determines the Plutonium engine that owns this route set, if any.
|
|
124
|
+
#
|
|
125
|
+
# Plutonium engines follow the SomeModule::Engine convention. A route set
|
|
126
|
+
# with no module scope belongs to the application. Anything else (e.g.
|
|
127
|
+
# graphql-ruby's Graphql::Dashboard, whose engine class is the module
|
|
128
|
+
# itself with no nested ::Engine) is not a Plutonium engine and has nothing
|
|
129
|
+
# for us to manage, so we return nil and let #clear!/#draw skip it rather
|
|
130
|
+
# than raise during route reload.
|
|
116
131
|
#
|
|
117
|
-
# @return [Class] The
|
|
132
|
+
# @return [Class, nil] The owning engine, or nil if not a Plutonium engine.
|
|
118
133
|
def determine_engine
|
|
119
134
|
engine_module = default_scope&.fetch(:module)
|
|
120
|
-
|
|
135
|
+
return Rails.application.class if engine_module.blank?
|
|
136
|
+
|
|
137
|
+
"#{engine_module.camelize}::Engine".safe_constantize
|
|
121
138
|
end
|
|
122
139
|
|
|
123
140
|
# Creates a resource configuration hash.
|
data/lib/plutonium/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plutonium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.53.
|
|
4
|
+
version: 0.53.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Froelich
|
|
@@ -1229,7 +1229,7 @@ metadata:
|
|
|
1229
1229
|
homepage_uri: https://radioactive-labs.github.io/plutonium-core/
|
|
1230
1230
|
source_code_uri: https://github.com/radioactive-labs/plutonium-core
|
|
1231
1231
|
post_install_message: |
|
|
1232
|
-
⚠️ Plutonium 0.53.
|
|
1232
|
+
⚠️ Plutonium 0.53.1 — breaking change
|
|
1233
1233
|
|
|
1234
1234
|
Entity-scoped URL helpers and path params have been renamed from
|
|
1235
1235
|
`<entity>_scope_*` to `<entity>_scoped_*`.
|