Class: Workarea::Admin::ReleaseViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Admin::ReleaseViewModel
show all
- Includes:
- CommentableViewModel
- Defined in:
- app/view_models/workarea/admin/release_view_model.rb
Instance Method Summary
collapse
#comment_count, #comments, #has_comments?, #new_comments_for?, #subscribed_users
Instance Method Details
#calendar_at ⇒ Object
18
19
20
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 18
def calendar_at
model.publish_at || model.published_at
end
|
#calendar_on ⇒ Object
22
23
24
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 22
def calendar_on
calendar_at&.to_date
end
|
#changesets_with_releasable ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 10
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
|
#timeline ⇒ Object
6
7
8
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 6
def timeline
@timeline ||= TimelineViewModel.new(model)
end
|
#undo ⇒ Object
26
27
28
29
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 26
def undo
return unless undo?
@undo ||= ReleaseViewModel.wrap(model.undo, options)
end
|
#undoes ⇒ Object
31
32
33
34
|
# File 'app/view_models/workarea/admin/release_view_model.rb', line 31
def undoes
return unless undoes?
@undoes ||= ReleaseViewModel.wrap(model.undoes, options)
end
|