Skip to content

Commit

Permalink
Simplify a bit rendering of hash arguments
Browse files Browse the repository at this point in the history
No need to convert to symbol if we're displaying all keys in the same
way.

Small follow-up to #201.
  • Loading branch information
rosa committed Nov 9, 2024
1 parent 58601c0 commit ba9c1f7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/helpers/mission_control/jobs/jobs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ def as_renderable_hash(argument)
elsif argument["_aj_serialized"]
ActiveJob::Arguments.deserialize([ argument ]).first
else
to_symbols = argument.values_at("_aj_symbol_keys", "_aj_ruby2_keywords").compact.flatten
argument.without("_aj_symbol_keys", "_aj_ruby2_keywords")
.transform_values { |v| as_renderable_argument(v) }
.transform_keys { |k| k.to_sym if k.in? to_symbols }
.map { |k, v| "#{k}: #{v}" }
.join(", ")
.then { |s| "{#{s}}" }
Expand Down

0 comments on commit ba9c1f7

Please sign in to comment.