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-8.0.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.4.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-7.0.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.3.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.2.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.1.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-5.1.3 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.1.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.0.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-6.0.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-5.1.2 app/models/foreman_puppet/host_class.rb
foreman_puppet-4.1.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-5.1.1 app/models/foreman_puppet/host_class.rb
foreman_puppet-5.1.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-4.1.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-4.0.4 app/models/foreman_puppet/host_class.rb
foreman_puppet-5.0.0 app/models/foreman_puppet/host_class.rb
foreman_puppet-4.0.3 app/models/foreman_puppet/host_class.rb
foreman_puppet-4.0.2 app/models/foreman_puppet/host_class.rb
foreman_puppet-3.0.7 app/models/foreman_puppet/host_class.rb