summaryrefslogtreecommitdiff
path: root/app/models/state_note.rb
blob: cbcb1c2b49d83d6ca33bfcff38dbc17d545593ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class StateNote < SyntheticNote
  def self.from_event(event, resource: nil, resource_parent: nil)
    attrs = note_attributes(event.state, event, resource, resource_parent)

    StateNote.new(attrs)
  end

  def note_html
    @note_html ||= "<p dir=\"auto\">#{note_text(html: true)}</p>"
  end

  private

  def note_text(html: false)
    event.state
  end
end