Sha256: ed311f552071461bf780217fcd2d14931af038f1336a3b962033ddc8076e2060
Contents?: true
Size: 465 Bytes
Versions: 17
Compression:
Stored size: 465 Bytes
Contents
module Hydra::PCDM::Validators class AncestorValidator def self.validate!(association, record) new(association.owner, record).validate! end attr_reader :owner, :record def initialize(owner, record) @owner = owner @record = record end def validate! return unless owner.ancestor?(record) raise ArgumentError, "#{record.class} with ID: #{record.id} failed to pass AncestorChecker validation" end end end
Version data entries
17 entries across 17 versions & 1 rubygems