2022-01-18 14:01:34 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-04-20 14:12:22 +02:00
|
|
|
# Defines the standard statistics data model.
|
2016-03-23 18:39:41 +01:00
|
|
|
module StatConcern
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
attribute :type, String
|
|
|
|
attribute :subType, String
|
|
|
|
attribute :date, String
|
|
|
|
attribute :stat, Integer
|
|
|
|
attribute :userId, Integer
|
|
|
|
attribute :gender, String
|
|
|
|
attribute :age, Integer
|
|
|
|
attribute :group, String
|
|
|
|
|
|
|
|
# has include Elasticsearch::Persistence::Model
|
2022-01-18 14:01:34 +01:00
|
|
|
index_name 'stats'
|
|
|
|
document_type to_s.demodulize&.underscore
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
end
|