Skip to content

Commit

Permalink
Fix failed tests that are relying on the method_missing method.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsitu committed Sep 20, 2019
1 parent 6f9c170 commit 8a6cfa2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ def original_file
af_object.original_file
end

##
# @return [Boolean] whether this instance is an audio.
def audio?
af_object = Wings::ActiveFedoraConverter.new(resource: self).convert
af_object.audio?
end

# TODO: This can be removed when we upgrade to ActiveFedora 12.0
# @return [String] the etag from the response headers
#
# @raise [RuntimeError] when the resource is new and has no etag
# @raise [Ldp::Gone] when the resource is deleted
def etag
raise "Unable to produce an etag for a unsaved object" unless persisted?
af_object = Wings::ActiveFedoraConverter.new(resource: self).convert
af_object.ldp_source.head.etag
end

# @param valkyrie [Boolean] Should the returned ids be for Valkyrie or AF objects?
# @return [Enumerable<Hydra::Works::Work>] The works this work is contained in
# @note This method avoids using the Hydra::Works version of parent_works because of Issue #361
Expand Down

0 comments on commit 8a6cfa2

Please sign in to comment.