Sha256: 2c6ba6a69e996f5c883a9f2147d07532d081d7598445aa4c519f07aadd7bb649

Contents?: true

Size: 578 Bytes

Versions: 45

Compression:

Stored size: 578 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, class_name: 'ForemanPuppet::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

45 entries across 45 versions & 1 rubygems

Version Path
foreman_puppet-1.0.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-1.0.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-1.0.0.rc.2 app/models/foreman_puppet/host_class.rb
foreman_puppet-1.0.0.rc.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-0.1.0 app/models/foreman_puppet/host_class.rb