Class: Analytic::TrackJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/analytic/track_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(session_id:, visitor_id:, host:, path:, ip:, timestamp: Time.current, params: {}) ⇒ Object

Parameters:

  • timestamp (Timestamp) (defaults to: Time.current)
  • session_id (String)
  • visitor_id (String)
  • host (String)
  • path (String)
  • params (Hash) (defaults to: {})


13
14
15
16
17
18
19
20
21
22
23
# File 'app/jobs/analytic/track_job.rb', line 13

def perform(session_id:, visitor_id:, host:, path:, ip:, timestamp: Time.current, params: {})
  Analytic::Event.create!(
    timestamp:,
    session_id:,
    visitor_id:,
    host:,
    path:,
    ip:,
    params:
  )
end