Sha256: a451b22e6da2e977891675041c9a0c8f409dc3a6fcb729798a52f5950e56dfbe
Contents?: true
Size: 838 Bytes
Versions: 9
Compression:
Stored size: 838 Bytes
Contents
module ForemanOpenscap class OvalContent < ApplicationRecord audited :except => [:scap_file] include Authorizable include Taxonomix include ScapFileContent before_destroy EnsureNotUsedBy.new(:oval_policies) scoped_search :on => :name, :complete_value => true has_many :oval_policies validates :name, :presence => true, :length => { :maximum => 255 }, uniqueness: true validates :url, :format => { :with => %r{\Ahttps?://} }, :allow_blank => true before_validation :fetch_remote_content, :if => lambda { |oval_content| oval_content.url.present? } def to_h { :id => id, :name => name, :original_filename => original_filename, :changed_at => changed_at } end private def fetch_remote_content ForemanOpenscap::Oval::SyncOvalContents.new.sync self end end end
Version data entries
9 entries across 9 versions & 1 rubygems