Sha256: 21c7c6115bb0e500b50959731b623619dcac1a7ba489b4dd5a93c903c16fecb3

Contents?: true

Size: 530 Bytes

Versions: 58

Compression:

Stored size: 530 Bytes

Contents

module Hyrax
  class VersionPresenter
    attr_reader :version, :current

    def initialize(version)
      @version = version
      @current = false
    end

    delegate :label, :uri, to: :version
    alias current? current

    def current!
      @current = true
    end

    def created
      @created ||= version.created.in_time_zone.to_formatted_s(:long_ordinal)
    end

    def committer
      vc = Hyrax::VersionCommitter.where(version_id: @version.uri)
      vc.empty? ? nil : vc.first.committer_login
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.5 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.4 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.3 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.2 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.1 app/presenters/hyrax/version_presenter.rb
hyrax-2.9.0 app/presenters/hyrax/version_presenter.rb
hyrax-2.8.0 app/presenters/hyrax/version_presenter.rb
hyrax-2.7.2 app/presenters/hyrax/version_presenter.rb
hyrax-2.7.1 app/presenters/hyrax/version_presenter.rb
hyrax-2.7.0 app/presenters/hyrax/version_presenter.rb
hyrax-2.6.0 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.rc1 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.beta3 app/presenters/hyrax/version_presenter.rb
hyrax-2.5.1 app/presenters/hyrax/version_presenter.rb
hyrax-2.5.0 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.beta2 app/presenters/hyrax/version_presenter.rb
hyrax-2.4.1 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.beta1 app/presenters/hyrax/version_presenter.rb
hyrax-2.4.0 app/presenters/hyrax/version_presenter.rb