Class: Mdm::Tag

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Metasploit::Model::Search
Defined in:
app/models/mdm/tag.rb

Overview

Tag assigned to #hosts. Tags can be used to group together hosts for targeting and reporting.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atDateTime

When this tag was created by #user.



# File 'app/models/mdm/tag.rb', line 32


#criticaltrue, false

Whether this tag represents a critical finding about the #hosts.



# File 'app/models/mdm/tag.rb', line 37


#descString

Longer description of what this tag should be used for or means when applied to a host.



# File 'app/models/mdm/tag.rb', line 43


#nameString

The name of the tag. The name is what a user actually enters to tag a host.



# File 'app/models/mdm/tag.rb', line 48


#report_detailtrue, false

Whether to include this tag in a report details section.



# File 'app/models/mdm/tag.rb', line 53


#report_summarytrue, false

Whether to include this tag in a report summary section.



# File 'app/models/mdm/tag.rb', line 59


#updated_atDateTime

The last time this tag was updated.



# File 'app/models/mdm/tag.rb', line 65


Instance Method Details

#destroy_if_orphanedvoid

This method returns an undefined value.

Destroy this tag if it has no #hosts_tags



101
102
103
104
105
106
107
# File 'app/models/mdm/tag.rb', line 101

def destroy_if_orphaned
  self.class.transaction do
    if hosts_tags.empty?
      destroy
    end
  end
end

#to_sString

The name of the tag. The name is what a user actually enters to tag a host.



110
111
112
# File 'app/models/mdm/tag.rb', line 110

def to_s
  name
end