Class: Redpen::Note

Inherits:
ApplicationRecord show all
Defined in:
app/models/redpen/note.rb

Overview

A note pinned to one element of one page: "this runs long", "swap this image". The page is its path and the element is a CSS selector, nothing else identifies them, so the same table serves any page a host renders and the pin lands wherever the element is when the page next paints. The snippet is what the element said at the time, for re-anchoring and for whoever reads the note without the page in front of them.

Instance Method Summary collapse

Instance Method Details

#reopen ⇒ Object



22
23
24
# File 'app/models/redpen/note.rb', line 22

def reopen
  update!(resolved_at: nil, resolution: nil)
end

#resolve(resolution = nil) ⇒ Object



18
19
20
# File 'app/models/redpen/note.rb', line 18

def resolve(resolution = nil)
  update!(resolved_at: Time.current, resolution: resolution.presence)
end

#resolved? ⇒ Boolean

Returns:

  • (Boolean)


26
# File 'app/models/redpen/note.rb', line 26

def resolved? = resolved_at.present?