Sha256: 5a2ea983ea461a5299bd2665168891d3f98b3c6a202dfd22404c5dc8d8914bc0
Contents?: true
Size: 539 Bytes
Versions: 21
Compression:
Stored size: 539 Bytes
Contents
module Hyrax class ParentService # @param [String] id - the id of a child FileSet # @return [ActiveFedora::Base] the parent object def self.parent_for(id) ids = ordered_by_ids(id) ActiveFedora::Base.find(ordered_by_ids(id).first) if ids.present? end def self.ordered_by_ids(id) if id.present? ActiveFedora::SolrService.query("{!join from=proxy_in_ssi to=id}ordered_targets_ssim:#{id}") .map { |x| x["id"] } else [] end end end end
Version data entries
21 entries across 21 versions & 1 rubygems