Skip to content

Commit

Permalink
Merge pull request #14202 from bronaghs/custom_attr_for_vm_labels
Browse files Browse the repository at this point in the history
Create a CustomAttribute for VmOrTemplate labels.
  • Loading branch information
blomquisg authored Mar 8, 2017
2 parents 570d2a4 + a17bb3b commit c30c333
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ems_refresh/save_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def save_vms_inventory(ems, hashes, target = nil)
[]
end

child_keys = [:operating_system, :hardware, :custom_attributes, :snapshots, :advanced_settings]
child_keys = [:operating_system, :hardware, :custom_attributes, :snapshots, :advanced_settings, :labels]
extra_infra_keys = [:host, :ems_cluster, :storage, :storages, :storage_profile, :raw_power_state, :parent_vm]
extra_cloud_keys = [
:flavor,
Expand Down
1 change: 1 addition & 0 deletions app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class VmOrTemplate < ApplicationRecord
has_many :direct_services, :through => :service_resources, :source => :service
belongs_to :tenant
has_many :connected_shares, -> { where(:resource_type => "VmOrTemplate") }, :foreign_key => :resource_id, :class_name => "Share"
has_many :labels, -> { where(:section => "labels") }, :class_name => "CustomAttribute", :as => :resource, :dependent => :destroy

acts_as_miq_taggable

Expand Down

0 comments on commit c30c333

Please sign in to comment.