2020-03-25 10:16:47 +01:00
|
|
|
class StatisticIndex < ApplicationRecord
|
2023-11-03 12:56:13 +01:00
|
|
|
include LabelI18nConcern
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
has_many :statistic_types
|
|
|
|
has_many :statistic_fields
|
|
|
|
has_one :statistic_graph
|
2023-07-20 16:55:22 +02:00
|
|
|
|
|
|
|
def concerned_by_reservation_context?
|
|
|
|
return false unless es_type_key.in? ReservationContext::APPLICABLE_ON
|
|
|
|
return false unless Setting.get('reservation_context_feature')
|
|
|
|
|
|
|
|
true
|
|
|
|
end
|
2023-08-24 18:31:16 +02:00
|
|
|
|
|
|
|
def show_coupon?
|
|
|
|
es_type_key.in? %w[subscription machine training event space order]
|
|
|
|
end
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|