Sha256: 6b8b55ab1d6789b8bdd7fec1f8dfa8476dbd1680d8b9c4b157d8825ddfc34b10
Contents?: true
Size: 537 Bytes
Versions: 9
Compression:
Stored size: 537 Bytes
Contents
module ForemanOpenscap class Asset < ApplicationRecord has_many :asset_policies, :dependent => :delete_all has_many :policies, :through => :asset_policies belongs_to :assetable, :polymorphic => true scope :hosts, lambda { where(:assetable_type => 'Host::Base') } def host fetch_asset('Host::Base') end def hostgroup fetch_asset('Hostgroup') end def name assetable.name end private def fetch_asset(type) assetable if assetable_type == type end end end
Version data entries
9 entries across 9 versions & 1 rubygems