svelte-on-rails 18.2.0 → 18.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af73c5cd3183f00e824daecfe7fea73742003d284820e4ae730c8f2edb0b5020
4
- data.tar.gz: 1ae10a55f1b364dafda2940111682ddc1db859092e449fc003375dc123567a5f
3
+ metadata.gz: 8db3e2e5e29e03c62cb4b49ea343194a12a61e1dfe4e36879ac79555f63e86ed
4
+ data.tar.gz: 7e41289fe014691b7521af7966500072c69a01dbfacd01b2eec90468fd1fcf2a
5
5
  SHA512:
6
- metadata.gz: a66543a9294f17be896778a13448cc28c99f60f504920eabbd530c50b5ee98ce6e6ddb9bb4ecc2025678c2e5059c80b06e8f44eaf1764017a7c7d48988a40cca
7
- data.tar.gz: 7348253c57f40921c9d9f2ee24410f3b3bcca3b4e0820b41d6d10c3d1c606a4696258d3de8796c69f7c4ed5ecc2c0f435248c3036846e326f751bc1ed4801388
6
+ metadata.gz: 3e6009374c45685b47f7cb39ea5b913e60c5c77ae553551ac12559c795f6c1cf4fd1e277d3049ce4fea8d6963d7ab78f1a5221decd8f8b1dbd80695d3942f988
7
+ data.tar.gz: 3682d6b970753ac6a06b1791c145a7c94ebacb59286439a7263fd819be8ebdc2942098b14428cd4014c7df9015432d290c3d99edc7afed75696a8d7e46a494fc
@@ -18,6 +18,7 @@ module SvelteOnRails
18
18
  @configs = redis_cache_store_configs
19
19
 
20
20
  @component_paths_cache = {}
21
+ @request_metrics = {}
21
22
 
22
23
  return unless defined?(Rails.root)
23
24
 
@@ -177,15 +178,13 @@ module SvelteOnRails
177
178
  end
178
179
 
179
180
  def initialize_request_metrics(request_uuid)
180
- @request_metrics ||= {}
181
- _req_id = @request_metrics[request_uuid]
182
-
183
- if request_uuid != _req_id
184
- @request_metrics = {
185
- request_uuid: request_uuid,
186
- total_time: 0.0
187
- }
188
- end
181
+ return if request_uuid == @request_metrics[:request_uuid]
182
+
183
+ @request_metrics = {
184
+ request_uuid: request_uuid,
185
+ total_time: 0.0
186
+ }
187
+
189
188
  end
190
189
 
191
190
  private
@@ -63,11 +63,12 @@ module SvelteOnRails
63
63
  end
64
64
 
65
65
  def model_attributes(model)
66
+ mn = model.model_name
66
67
  {
67
- 'humanName' => model.model_name.human,
68
- 'humanNamePlural' => model.model_name.human(count: :many),
69
- 'modelKey' => model.to_s.underscore,
70
- 'modelKeyPlural' => model.to_s.underscore.pluralize,
68
+ 'humanName' => mn.human,
69
+ 'humanNamePlural' => mn.human(count: :many),
70
+ 'paramKey' => mn.param_key,
71
+ 'routeKey' => mn.route_key,
71
72
  }
72
73
  end
73
74
 
@@ -124,7 +124,7 @@ module SvelteOnRails
124
124
 
125
125
  puts sep_line
126
126
  puts failure_title
127
- puts "ERROR: #{title}" if title
127
+ puts title if title
128
128
  puts sep_line
129
129
  puts messages.join("\n#{inner_sep}\n")
130
130
  puts sep_line
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svelte-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.2.0
4
+ version: 18.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair