Class: Hyrax::SolrDocument::OrderedMembers
- Inherits:
-
ModelDecorator
- Object
- Draper::Decorator
- ModelDecorator
- Hyrax::SolrDocument::OrderedMembers
- Defined in:
- app/models/concerns/hyrax/solr_document/ordered_members.rb
Overview
this decorator is intended for use with data representations other than the core model objects, as an alternative to a direct query of the canonical database. for example, it can be used with ‘SolrDocument` to quickly retrieve member order in a way that is compatible with the fast access required in Blacklight’s search contexts.
Decorates an object responding to ‘#id` with an `#ordered_member_ids` method.
Instance Method Summary collapse
-
#ordered_member_ids ⇒ Enumerable<String>
Ids in the order of their membership, only includes ids of ordered members.
Methods inherited from ModelDecorator
Instance Method Details
#ordered_member_ids ⇒ Enumerable<String>
the purpose of this method is to provide fast access to member order. currently this is achieved by accessing indexed list proxies from Solr. however, this strategy may change in the future.
Returns ids in the order of their membership, only includes ids of ordered members.
27 28 29 30 |
# File 'app/models/concerns/hyrax/solr_document/ordered_members.rb', line 27 def ordered_member_ids return [] if id.blank? @ordered_member_ids ||= query_for_ordered_ids end |