From c9b9869c4ce3d01f632321cbfd157623730d20f5 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Fri, 15 Mar 2019 16:01:06 -0400 Subject: [PATCH] rename objects to child_objects Use consistent naming in methods that also provides information on the direction of the relationship to make methods easier to grok. --- README.md | 1 + .../pcdm/models/concerns/pcdm_valkyrie_behavior.rb | 12 +++++++----- .../models/concerns/pcdm_valkyrie_behavior_spec.rb | 14 +++++++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b5984387a6..17e4fe8e0c 100644 --- a/README.md +++ b/README.md @@ -345,3 +345,4 @@ This software has been developed by and is brought to you by the Samvera communi [Samvera website](http://samvera.org/). ![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2) + \ No newline at end of file diff --git a/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb b/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb index 562ff4b5ad..5c8ae4081c 100644 --- a/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb +++ b/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb @@ -35,20 +35,22 @@ def parent_collection_ids(valkyrie: false) # Gives the subset of #members that are PCDM objects # @return [Enumerable | Enumerable] an enumerable over the members # that are PCDM objects - def objects(valkyrie: false) + def child_objects(valkyrie: false) af_objects = Wings::ActiveFedoraConverter.new(resource: self).convert.objects return af_objects unless valkyrie af_objects.map(&:valkyrie_resource) end - alias members objects - alias ordered_members objects + alias objects child_objects + alias members child_objects + alias ordered_members child_objects ## # Gives a subset of #member_ids, where all elements are PCDM objects. # @return [Enumerable | Enumerable