Sha256: 5c6ee53d94b47573b4ad87869f4f371b94ff18c9f2a40897ea95aa582a427bb5

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

module ForemanPuppet
  class HostClass < ApplicationRecord
    self.table_name = 'host_classes'

    audited associated_with: :host
    include Authorizable

    validates_lengths_from_database
    belongs_to :puppetclass
    belongs_to :host_puppet_facet
    has_one :host, through: :host_puppet_facet

    validates :puppetclass_id, presence: true, uniqueness: { scope: :host_puppet_facet_id }

    def name
      "#{host_puppet_facet.host} - #{puppetclass}"
    end

    def check_permissions_after_save
      true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_puppet-0.0.2 app/models/foreman_puppet/host_class.rb
foreman_puppet-0.0.1 app/models/foreman_puppet/host_class.rb