Skip to content

Commit 2302577

Browse files
authored
Merge pull request #9250 from GilbertCherrie/fix_request_page_tag_value
Fix request page tag value
2 parents 6c7b881 + 50fdfdb commit 2302577

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

app/views/miq_request/_request_dialog_details.html.haml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
= h(field.values.detect { |k, _v| k == wf.value(field.name) }.try(:last) || wf.value(field.name))
2929

3030
- when "DialogFieldDropDownList"
31+
-# If the automation engine is changed to return arrays instead of
32+
-# strings separated by "\u001F" then we need to change the code below
3133
= h(field.value.blank? ? _("<None>") : field.value.to_s.gsub("\x1F", ", "))
3234

3335
- when 'DialogFieldTagControl'
3436
- value = wf.value(field.name) || '' # it returns in format Clasification::id
35-
- classifications = value.split(',').map do |c|
36-
- classification = Classification.find_by(id: c.split('::').second)
37-
- classification.description if classification
38-
- if classifications.empty?
39-
= h('')
40-
-else
41-
= h(classifications.join(', '))
37+
-# If the automation engine is changed to return arrays instead of
38+
-# strings separated by "\u001F" then we need to change the code below
39+
- classification_ids = value.split("\u001F").map { |tag| tag.split('::').second }
40+
- classifications = Classification.where(:id => classification_ids).pluck(:description)
41+
= h(classifications.join(', '))

0 commit comments

Comments
 (0)