Class: Decidim::DecidimAwesome::PaperTrailBasePresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb

Direct Known Subclasses

RoleBasePresenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, html: true) ⇒ PaperTrailBasePresenter

Returns a new instance of PaperTrailBasePresenter.



8
9
10
11
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 8

def initialize(entry, html: true)
  @entry = entry
  @html = html
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



6
7
8
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 6

def entry
  @entry
end

#htmlObject (readonly)

Returns the value of attribute html.



6
7
8
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 6

def html
  @html
end

Instance Method Details

#itemObject

try to use the object in the database if exists Note that “reify” does not work on “create” events



15
16
17
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 15

def item
  @item ||= entry&.item
end

#item_idObject



23
24
25
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 23

def item_id
  @item_id ||= entry&.item_id
end

#item_typeObject



19
20
21
# File 'app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb', line 19

def item_type
  @item_type ||= entry&.item_type
end