- if object && object.attributes.values.any?
  %tr
    %td
      = name
    %td
      .node-attrs
        - object.attributes.select { |_, val| val.present? }.sort_by(&:first).each do |key, value|
          .attribute
            .key<>= key
            .value>
              - if value.is_a?(Hash)
                - value.each do |sub_key, sub_value|
                  %span.sub-attribute
                    == #{sub_key}: #{sub_value}
              - else
                - if object_attribute_is_node?(key)
                  - value.each.with_index do |node_key, index|
                    = succeed(index == value.length - 1 ? '' : ', ') do
                      = link_to node_key, object_attribute_node_path(node_key, object)
                - else
                  = value

- if object && object.attributes.values.any?
  %tr
    %td
      = name
    %td
      .node-attrs
        - object.attributes.select { |_, val| val.present? }.sort_by(&:first).each do |key, value|
          .attribute
            .key<>= key
            .value>
              - if value.is_a?(Hash)
                - value.each do |sub_key, sub_value|
                  %span.sub-attribute
                    == #{sub_key}: #{sub_value}
              - else
                - if object_attribute_is_node?(key)
                  - value_array = Array(value)
                  - value_array.each.with_index do |node_key, index|
                    = succeed(index == value_array.length - 1 ? '' : ', ') do
                      = link_to node_key, object_attribute_node_path(node_key, object)
                - else
                  = value

Fix that object attributes are not always arrays
Fix that object attributes are not always arrays
