From f9521f89e55f019c103cd5b6eb6f181c23c4ba37 Mon Sep 17 00:00:00 2001 From: Aparna Karve Date: Tue, 11 Sep 2018 10:42:00 -0700 Subject: [PATCH] virtual col for parent blue folder path with no non-display folders --- app/models/vm_or_template.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/vm_or_template.rb b/app/models/vm_or_template.rb index 650436d50c94..a23c401208dc 100644 --- a/app/models/vm_or_template.rb +++ b/app/models/vm_or_template.rb @@ -151,6 +151,7 @@ class VmOrTemplate < ApplicationRecord virtual_column :v_owning_blue_folder, :type => :string, :uses => :all_relationships virtual_column :v_owning_blue_folder_path, :type => :string, :uses => :all_relationships virtual_column :v_datastore_path, :type => :string, :uses => :storage + virtual_column :v_folder_path_no_non_display_folders, :type => :string, :uses => :all_relationships virtual_column :thin_provisioned, :type => :boolean, :uses => {:hardware => :disks} virtual_column :used_storage, :type => :integer, :uses => [:used_disk_storage, :mem_cpu] virtual_column :used_storage_by_state, :type => :integer, :uses => :used_storage @@ -803,6 +804,11 @@ def parent_datacenter end alias_method :owning_datacenter, :parent_datacenter + def parent_blue_folder_path_with_excluded_non_display_folders + parent_blue_folder_path(:exclude_non_display_folders => true) + end + alias_method :v_folder_path_no_non_display_folders, :parent_blue_folder_path_with_excluded_non_display_folders + def lans !hardware.nil? ? hardware.nics.collect(&:lan).compact : [] end