Skip to content

Commit

Permalink
virtual col for parent blue folder path with no non-display folders
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed Sep 12, 2018
1 parent c115691 commit 26289cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/transformation_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def describe_vm(vm, reason)
{
"name" => vm.name,
"cluster" => vm.ems_cluster.try(:name) || '',
"path" => vm.ext_management_system ? "#{vm.ext_management_system.name}/#{vm.parent_blue_folder_path(:exclude_non_display_folders => true)}" : '',
"path" => vm.ext_management_system ? "#{vm.ext_management_system.name}/#{vm.v_parent_blue_folder_display_path}" : '',
"allocated_size" => vm.allocated_disk_storage,
"id" => vm.id,
"ems_cluster_id" => vm.ems_cluster_id,
Expand Down
6 changes: 6 additions & 0 deletions app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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_parent_blue_folder_display_path, :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
Expand Down Expand Up @@ -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_parent_blue_folder_display_path, :parent_blue_folder_path_with_excluded_non_display_folders

def lans
!hardware.nil? ? hardware.nics.collect(&:lan).compact : []
end
Expand Down

0 comments on commit 26289cb

Please sign in to comment.