Class: ActionTrace::FetchPageVisits

Inherits:
Object
  • Object
show all
Includes:
ActivityLogFetchable, Interactor
Defined in:
app/interactors/action_trace/fetch_page_visits.rb

Instance Method Summary collapse

Methods included from ActivityLogFetchable

#base_scope, #should_fetch?

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
# File 'app/interactors/action_trace/fetch_page_visits.rb', line 8

def call
  return unless should_fetch_any?(%w[page_visit session_end])

  scope = base_scope(Ahoy::Event)
  scope = apply_source_filter(scope)

  context.total_count += scope.count
  context.raw_collection += map_entries(scope)
end