From b42f1bec9d6a0ddcaf9ec9d5366042fad1924c0f Mon Sep 17 00:00:00 2001 From: PanSpagetka Date: Mon, 19 Nov 2018 15:55:59 +0100 Subject: [PATCH] Dont return different types in virtual columns, delete not needed virtual columns --- 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