Sha256: b080c8b2c70fc1cad45739399ba77168f655efc0828aafeda529253e8d1ec084

Contents?: true

Size: 360 Bytes

Versions: 12

Compression:

Stored size: 360 Bytes

Contents

module ForemanSalt
  class SaltModuleEnvironment < ApplicationRecord
    belongs_to :salt_environment
    belongs_to :salt_module

    before_destroy :remove_from_hosts

    private

    def remove_from_hosts
      HostSaltModule.joins(:host).where(hosts: { salt_environment_id: salt_environment_id }, salt_module_id: salt_module_id).destroy
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_salt-17.0.0 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-16.0.3 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-16.0.2 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-16.0.1 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-16.0.0 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.2.3 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.2.2 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.2.1 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.2.0 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.1.0 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-15.0.0 app/models/foreman_salt/salt_module_environment.rb
foreman_salt-14.1.0 app/models/foreman_salt/salt_module_environment.rb