Sha256: 89fba95fa5a5f78dfda349a288012bf01f6b097646dca093e9f0d3b51fa22bbd

Contents?: true

Size: 764 Bytes

Versions: 21

Compression:

Stored size: 764 Bytes

Contents

module Ddr
  module Models
    module FixityCheckable

      def datastreams_to_validate
        datastreams.select { |dsid, ds| ds.has_content? }
      end
      alias_method :attached_files_having_content, :datastreams_to_validate

      def fixity_checks
        Ddr::Events::FixityCheckEvent.for_object(self)
      end

      # Returns a Ddr::Actions::FixityCheck::Result for the object
      def fixity_check
        Ddr::Actions::FixityCheck.execute(self)
      end

      def last_fixity_check
        fixity_checks.last
      end

      def last_fixity_check_on
        last_fixity_check && last_fixity_check.event_date_time
      end

      def last_fixity_check_outcome
        last_fixity_check && last_fixity_check.outcome
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ddr-models-2.6.2 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.1 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.0 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.0.rc4 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.0.rc3 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.0.rc2 lib/ddr/models/fixity_checkable.rb
ddr-models-2.6.0.rc1 lib/ddr/models/fixity_checkable.rb
ddr-models-2.5.3 lib/ddr/models/fixity_checkable.rb
ddr-models-2.5.2 lib/ddr/models/fixity_checkable.rb
ddr-models-2.5.1 lib/ddr/models/fixity_checkable.rb
ddr-models-2.5.0 lib/ddr/models/fixity_checkable.rb
ddr-models-2.5.0.rc1 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.16 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.15 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.14 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.13 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.12 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.11 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.10 lib/ddr/models/fixity_checkable.rb
ddr-models-2.4.9 lib/ddr/models/fixity_checkable.rb