Skip to content

Commit

Permalink
Parse bs_tree value to JSON if it is string
Browse files Browse the repository at this point in the history
A string value does not work in javascript objects, so the tree had problems with refreshing after deleting classes in miq_ae_class
  • Loading branch information
rvsia committed Sep 3, 2018
1 parent 25c5248 commit 2f5bc86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -2143,7 +2143,11 @@ def controller_for_common_methods
def reload_trees_by_presenter(presenter, trees)
trees.each do |tree|
next unless tree.present?
presenter.reload_tree(tree.name, tree.locals_for_render[:bs_tree])
if tree.locals_for_render[:bs_tree].kind_of?(String)
presenter.reload_tree(tree.name, JSON.parse(tree.locals_for_render[:bs_tree]))
else
presenter.reload_tree(tree.name, tree.locals_for_render[:bs_tree])
end
end
end

Expand Down

0 comments on commit 2f5bc86

Please sign in to comment.