Sha256: 65b9224f3119e2875cd4fb1da01088d83d1aefbd9b90779dca297e01ce163040
Contents?: true
Size: 703 Bytes
Versions: 40
Compression:
Stored size: 703 Bytes
Contents
module ForemanOpenscap module SmartProxyExtensions extend ActiveSupport::Concern included do has_many :openscap_hostgroups, :foreign_key => 'openscap_proxy_id', :class_name => "::Hostgroup" has_many :openscap_hosts, :foreign_key => 'openscap_proxy_id', :class_name => "::Host" has_many :arf_reports, :foreign_key => 'openscap_proxy_id', :class_name => "ForemanOpenscap::ArfReport" PORT_MATCH = /:(\d+)\z/ after_destroy :delete_associated_arf_reports end def port url.match(PORT_MATCH)[1].to_i end private def delete_associated_arf_reports ForemanOpenscap::ArfReport.where(:openscap_proxy_id => id).delete_all end end end
Version data entries
40 entries across 40 versions & 1 rubygems