From a26fa1e0456d845540587e6b4016976d196cd438 Mon Sep 17 00:00:00 2001 From: Ari Zellner Date: Mon, 20 Mar 2017 18:35:31 +0200 Subject: [PATCH] change CustomAttribute columns display name in reports to 'Labels: name' --- lib/miq_expression.rb | 4 ++-- spec/lib/miq_expression_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/miq_expression.rb b/lib/miq_expression.rb index 00893dfb9a5..8701db6f3ab 100644 --- a/lib/miq_expression.rb +++ b/lib/miq_expression.rb @@ -1173,10 +1173,10 @@ def self._custom_details_for(model, options) klass.custom_keys.each do |custom_key| custom_detail_column = [model, CustomAttributeMixin::CUSTOM_ATTRIBUTES_PREFIX + custom_key].join("-") - custom_detail_name = custom_key + custom_detail_name = _("Labels: %{custom_key}") % { :custom_key => custom_key } if options[:include_model] model_name = Dictionary.gettext(model, :type => :model, :notfound => :titleize) - custom_detail_name = [model_name, custom_key].join(" : ") + custom_detail_name = [model_name, custom_detail_name].join(" : ") end custom_attributes_details.push([custom_detail_name, custom_detail_column]) end diff --git a/spec/lib/miq_expression_spec.rb b/spec/lib/miq_expression_spec.rb index d9051a458bb..a1b229d3137 100644 --- a/spec/lib/miq_expression_spec.rb +++ b/spec/lib/miq_expression_spec.rb @@ -1958,7 +1958,7 @@ custom_attr1 custom_attr2 - expect(MiqExpression._custom_details_for("Vm", {})).to eq([["CATTR_1", "Vm-virtual_custom_attribute_CATTR_1"]]) + expect(MiqExpression._custom_details_for("Vm", {})).to eq([["Labels: CATTR_1", "Vm-virtual_custom_attribute_CATTR_1"]]) end end