Module: Observ::Reviewable

Extended by:
ActiveSupport::Concern
Included in:
Session, Trace
Defined in:
app/models/concerns/observ/reviewable.rb

Instance Method Summary collapse

Instance Method Details

#enqueue_for_review!(reason:, priority: :normal, details: {}) ⇒ Object

Enqueue this item for review, or return existing review_item if already queued



12
13
14
15
16
17
18
19
# File 'app/models/concerns/observ/reviewable.rb', line 12

def enqueue_for_review!(reason:, priority: :normal, details: {})
  review_item || create_review_item!(
    reason: reason.to_s,
    reason_details: details,
    priority: priority,
    status: :pending
  )
end

#in_review_queue?Boolean

Returns true if this item is in the review queue

Returns:

  • (Boolean)


37
38
39
# File 'app/models/concerns/observ/reviewable.rb', line 37

def in_review_queue?
  review_item.present?
end

#pending_review?Boolean

Returns true if review is pending or in progress

Returns:

  • (Boolean)


32
33
34
# File 'app/models/concerns/observ/reviewable.rb', line 32

def pending_review?
  review_item&.pending? || review_item&.in_progress?
end

#review_statusObject

Returns the review status or 'not_queued' if not in queue



22
23
24
# File 'app/models/concerns/observ/reviewable.rb', line 22

def review_status
  review_item&.status || "not_queued"
end

#reviewed?Boolean

Returns true if review has been completed

Returns:

  • (Boolean)


27
28
29
# File 'app/models/concerns/observ/reviewable.rb', line 27

def reviewed?
  review_item&.completed?
end