Sha256: 0e4ed3db56ee92c3fb4fb77487d0b2eb49fe7288401b6eb4a1fc46a362941bbf

Contents?: true

Size: 431 Bytes

Versions: 10

Compression:

Stored size: 431 Bytes

Contents

module Ddr
  module Models
    module HasChildren

      DEFAULT_SORT = "#{Ddr::Index::Fields::LOCAL_ID} ASC, #{Ddr::Index::Fields::OBJECT_CREATE_DATE} ASC"

      def first_child
        ActiveFedora::SolrService.lazy_reify_solr_results(sorted_children).first
      end

      def sorted_children
        ActiveFedora::SolrService.query(association_query(:children), sort: DEFAULT_SORT, rows: 999999)
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/models/has_children.rb
ddr-models-2.10.2 lib/ddr/models/has_children.rb
ddr-models-2.10.1 lib/ddr/models/has_children.rb
ddr-models-2.10.0 lib/ddr/models/has_children.rb
ddr-models-2.10.0.rc2 lib/ddr/models/has_children.rb
ddr-models-2.10.0.rc1 lib/ddr/models/has_children.rb
ddr-models-2.9.2 lib/ddr/models/has_children.rb
ddr-models-2.9.1 lib/ddr/models/has_children.rb
ddr-models-2.9.0 lib/ddr/models/has_children.rb
ddr-models-2.9.0.rc1 lib/ddr/models/has_children.rb