Skip to content

Commit

Permalink
added virtual column archived. It will be used to filter out archived…
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Aug 7, 2018
1 parent f73a2f4 commit e767b47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class Host < ApplicationRecord
virtual_delegate :annotation, :to => :hardware, :prefix => "v", :allow_nil => true
virtual_column :vmm_vendor_display, :type => :string
virtual_column :ipmi_enabled, :type => :boolean
virtual_column :archived, :type => :boolean

virtual_has_many :resource_pools, :uses => :all_relationships
virtual_has_many :miq_scsi_luns, :uses => {:hardware => {:storage_adapters => {:miq_scsi_targets => :miq_scsi_luns}}}
Expand Down Expand Up @@ -1768,6 +1769,7 @@ def read_only_storages
def archived?
ems_id.nil?
end
alias_method :archived, :archived?

def normalized_state
return 'archived' if archived?
Expand Down

0 comments on commit e767b47

Please sign in to comment.