Sha256: 4a680318fbb2ce582cca599cf5006dc77adc9d5a8ca73fb45a4ee687046d3fc2
Contents?: true
Size: 556 Bytes
Versions: 58
Compression:
Stored size: 556 Bytes
Contents
module Hyrax class VersionListPresenter def initialize(version_list) @raw_list = version_list end delegate :each, to: :wrapped_list private def wrapped_list @wrapped_list ||= @raw_list.map { |v| Hyrax::VersionPresenter.new(v) } # wrap each item in a presenter .sort { |a, b| b.version.created <=> a.version.created } # sort list of versions based on creation date .tap { |l| l.first.try(:current!) } # set the first version to the current version end end end
Version data entries
58 entries across 58 versions & 2 rubygems