Welcome to mirror list, hosted at ThFree Co, Russian Federation.

state_note.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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