Module: Protege::TraceHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/protege/trace_helper.rb

Overview

View helpers for the tracing dashboard — the one place the trace views ask about tracing state, so the config.tracing hash shape stays out of the templates.

Instance Method Summary collapse

Instance Method Details

#recent_tracesActiveRecord::Relation<Protege::Trace>

Fetch captured turns newest first — the sidebar list. A helper (like inbox_threads) so the show page's sidebar sources its own list without the controller re-deriving it into an ivar.

Returns:



11
12
13
# File 'app/helpers/protege/trace_helper.rb', line 11

def recent_traces
  Trace.recent
end

#tracing_enabled?Boolean

Whether inference tracing is currently capturing turns — the config.tracing master switch.

Returns:

  • (Boolean)

    true when tracing is enabled



18
19
20
# File 'app/helpers/protege/trace_helper.rb', line 18

def tracing_enabled?
  Protege.configuration.tracing[:enabled] ? true : false
end