Sha256: fa7c2d937d577677c8d00883bbebc4b91277812c6b36a5ac658d3b1e12247cd7

Contents?: true

Size: 945 Bytes

Versions: 25

Compression:

Stored size: 945 Bytes

Contents

module Workarea
  module Admin
    class ReleaseViewModel < ApplicationViewModel
      include CommentableViewModel

      def timeline
        @timeline ||= TimelineViewModel.new(model)
      end

      def changesets_with_releasable
        @changesets_with_releasable ||= model
                          .changesets
                          .map { |c| ChangesetViewModel.wrap(c) }
                          .select { |changeset| changeset.root.present? }
                          .reject { |changeset| changeset.releasable.blank? }
      end

      def calendar_at
        model.publish_at || model.published_at
      end

      def calendar_on
        calendar_at&.to_date
      end

      def undo
        return unless undo?
        @undo ||= ReleaseViewModel.wrap(model.undo, options)
      end

      def undoes
        return unless undoes?
        @undoes ||= ReleaseViewModel.wrap(model.undoes, options)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
workarea-admin-3.5.23 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.22 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.21 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.20 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.19 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.18 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.17 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.16 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.15 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.14 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.13 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.12 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.11 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.10 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.9 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.8 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.7 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.6 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.5 app/view_models/workarea/admin/release_view_model.rb
workarea-admin-3.5.4 app/view_models/workarea/admin/release_view_model.rb