From ee46c90eddf6be91b4b21bc9ef1cf3d4323e2970 Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Tue, 27 Nov 2018 15:10:33 +0100 Subject: [PATCH] Merge pull request #18217 from PanSpagetka/fix-miq-template-virtual-cols Dont return different types in virtual columns (cherry picked from commit ab470a4845a44e9dec6cd77613de31f284adfbb1) https://bugzilla.redhat.com/show_bug.cgi?id=1610927 --- app/models/miq_template.rb | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/app/models/miq_template.rb b/app/models/miq_template.rb index ec2624ec7c8..df8f3fdb50b 100644 --- a/app/models/miq_template.rb +++ b/app/models/miq_template.rb @@ -6,11 +6,9 @@ class MiqTemplate < VmOrTemplate virtual_column :display_type, :type => :string virtual_column :display_operating_system, :type => :string virtual_column :display_platform, :type => :string - virtual_column :display_cpu_cores, :type => :string - virtual_column :display_memory, :type => :string - virtual_column :display_snapshots, :type => :string virtual_column :display_tenant, :type => :string virtual_column :display_deprecated, :type => :string + virtual_column :display_memory, :type => :integer include_concern 'Operations' @@ -83,28 +81,8 @@ def display_platform end end - def display_cpu_cores - if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?) - _("N/A") - else - cpu_total_cores - end - end - def display_memory - if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?) - _("N/A") - else - mem_cpu.to_i * 1024 * 1024 - end - end - - def display_snapshots - if respond_to?(:volume_template?) || respond_to?(:volume_snapshot_template?) - _("N/A") - else - v_total_snapshots - end + mem_cpu.to_i * 1024 * 1024 end def display_tenant