Sha256: c0e10ac17f7adba973ad0e91de4eb4a5f2df1bfe1cd71c43b29022f583391b7d
Contents?: true
Size: 510 Bytes
Versions: 71
Compression:
Stored size: 510 Bytes
Contents
module ForemanOpenscap class Asset < ApplicationRecord 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
71 entries across 71 versions & 1 rubygems