Sha256: 91890d5a7f782237e9e9c8a47fe519327736d27d9ab03fd846cd5fbea824288d
Contents?: true
Size: 511 Bytes
Versions: 23
Compression:
Stored size: 511 Bytes
Contents
module ForemanOpenscap class Asset < ActiveRecord::Base has_many :asset_policies 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
23 entries across 23 versions & 1 rubygems