Sha256: 61279acec595c3d9ec59acc556e50bbd91e366fc6d64298644666c3ce4632610
Contents?: true
Size: 871 Bytes
Versions: 45
Compression:
Stored size: 871 Bytes
Contents
require "event_capture/events_controller" # Augment/override behavior. class EventCapture::EventsController before_action :authenticate_participant! def event_params { kind: params[:kind], payload: params[:payload].merge(remote_ip: request.remote_ip), emitted_at: params[:emittedAt], participant_id: current_participant.id } end end require "event_capture/event" class EventCapture::Event belongs_to :participant def self.next_event_for(event) where(participant_id: event.participant_id) .where.not(kind: "videoPlay") .where("emitted_at > ?", event.emitted_at) .select(:participant_id, :kind, :emitted_at) .order(:emitted_at) .limit(1) .first end def current_url payload[:currentUrl] end def button_html payload[:buttonHtml] end def headers payload[:headers] end end
Version data entries
45 entries across 45 versions & 1 rubygems