Sha256: 343fecc9e163bb7fff12c9e6a4276070e15b6f69bd98e2a12e8ebcec7371b6aa

Contents?: true

Size: 926 Bytes

Versions: 22

Compression:

Stored size: 926 Bytes

Contents

class ChecksumAuditLog < ActiveRecord::Base

  def ChecksumAuditLog.get_audit_log(version)
    ChecksumAuditLog.find_or_create_by_pid_and_dsid_and_version(pid: version.pid,
                                                                dsid: version.dsid,
                                                                version: version.versionID)
  end

  def ChecksumAuditLog.prune_history(version)
    ## Check to see if there are previous passing logs that we can delete
    # we want to keep the first passing event after a failure, the most current passing event, and all failures so that this table doesn't grow too large
    # Simple way (a little naieve): if the last 2 were passing, delete the first one
    logs = GenericFile.load_instance_from_solr(version.pid).logs(version.dsid)
    list = logs.limit(2)
    if list.size > 1 && (list[0].pass == 1) && (list[1].pass == 1)
      list[0].destroy
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
sufia-5.0.0 sufia-models/app/models/checksum_audit_log.rb
sufia-models-5.0.0 app/models/checksum_audit_log.rb
sufia-5.0.0.rc1 sufia-models/app/models/checksum_audit_log.rb
sufia-models-5.0.0.rc1 app/models/checksum_audit_log.rb
sufia-4.3.1 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.3.1 app/models/checksum_audit_log.rb
sufia-4.2.0 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.2.0 app/models/checksum_audit_log.rb
sufia-4.1.0 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.1.0 app/models/checksum_audit_log.rb
sufia-4.0.1 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.0.1 app/models/checksum_audit_log.rb
sufia-models-4.0.0 app/models/checksum_audit_log.rb
sufia-4.0.0 sufia-models/app/models/checksum_audit_log.rb
sufia-4.0.0.rc2 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.0.0.rc2 app/models/checksum_audit_log.rb
sufia-4.0.0.rc1 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.0.0.rc1 app/models/checksum_audit_log.rb
sufia-4.0.0.beta4 sufia-models/app/models/checksum_audit_log.rb
sufia-models-4.0.0.beta4 app/models/checksum_audit_log.rb