solid_stack_web 1.6.2 → 1.6.3

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: fc70dcb623bcb04ca239a23b6a15e173129bc9362166565d73671bfb7dc08edc
4
- data.tar.gz: 1afc6e66782fb662ab28b1a50425a05f4de49c3f67a0a6504f6b965c4849d7b0
3
+ metadata.gz: b7bbfe1cfe021008f9094a393c1565d9f5e6464ec45357110691afb12c95d7c4
4
+ data.tar.gz: 4377ffd5d97640175f5e5c2c0fc5216146cfc64bc556b5e05ae27982bd1ed12f
5
5
  SHA512:
6
- metadata.gz: e2fd1f48e168729bdcaf663b2f14d9246fdc34aa6dd1722f569a815990d646a8f60a42b7c8d46f38bd7d1289fdd089d22df9cd50405fcb8720019dc64f259ff4
7
- data.tar.gz: 2fb4bf7fa63f65c33f4fed44b0e3c8803b1de86bf5c3f83aad42d87620ddff4a7c6ceb1c84731d6a5d4e6a0eb2b9a460ecb3e79b1890f36fb0cf0cbfde7f9ce4
6
+ metadata.gz: c51a465014bb16d118f80d0295fc1305c79ab03dd8fefd63e6b3a8f68d70b0329e4edc919dda7b5f33acb80263a429e269d22d0c33d4ed887cdce5db1d71c49c
7
+ data.tar.gz: faca09124c58ed725ee12f5ad4881a85759987fef8da52bf0038d61bc0ffec00cac8925fe19ed05ad3fa7dac9e9dc9f53edd89565523b75c64528217c279e039
@@ -23,9 +23,7 @@ module SolidStackWeb
23
23
 
24
24
  def show
25
25
  @execution = Job::EXECUTION_MODELS[@status].includes(:job).find(params[:id])
26
- @arguments = JSON.parse(@execution.job.arguments) if @execution.job.arguments.present?
27
- rescue JSON::ParserError
28
- @arguments = nil
26
+ @arguments = parsed_arguments(@execution.job.arguments)
29
27
  end
30
28
 
31
29
  def destroy
@@ -53,6 +51,17 @@ module SolidStackWeb
53
51
 
54
52
  private
55
53
 
54
+ # SolidQueue::Job serializes arguments as JSON, so real jobs yield an already-parsed Hash;
55
+ # only legacy or hand-written rows hold a raw JSON string.
56
+ def parsed_arguments(arguments)
57
+ return if arguments.blank?
58
+ return arguments unless arguments.is_a?(String)
59
+
60
+ JSON.parse(arguments)
61
+ rescue JSON::ParserError
62
+ nil
63
+ end
64
+
56
65
  def set_status
57
66
  @status = params[:status].presence_in(Job::STATUSES) || "ready"
58
67
  end
@@ -1,3 +1,3 @@
1
1
  module SolidStackWeb
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_stack_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Smith