# frozen_string_literal: true class AnalyticsEvent < ApplicationRecord self.table_name = "analytics_events" EVENT_TYPES = %w[click scroll pageview].freeze DEVICES = %w[mobile tablet desktop].freeze validates :page_path, presence: true validates :device, inclusion: { in: DEVICES } validates :event_type, inclusion: { in: EVENT_TYPES } validates :occurred_at, presence: true end