Sha256: cb4bd9ac8d8893c59692b2bceab78b7b5f7b8f2e2f4bb78a709fc2a030c095b9
Contents?: true
Size: 552 Bytes
Versions: 26
Compression:
Stored size: 552 Bytes
Contents
module ForemanOpenscap module ScapFileContent require 'digest/sha2' extend ActiveSupport::Concern included do validates :digest, :presence => true validates :scap_file, :presence => true before_validation :redigest, :if => lambda { |file_content| file_content.persisted? && file_content.scap_file_changed? } end def digest self[:digest] ||= Digest::SHA256.hexdigest(scap_file.to_s) end private def redigest self[:digest] = Digest::SHA256.hexdigest(scap_file.to_s) end end end
Version data entries
26 entries across 26 versions & 1 rubygems