@@ -7,91 +7,92 @@ def change
77
88 # StatisticIndex
99
10- statistic_index_subscription = StatisticIndex . find_by! ( es_type_key : 'subscription' )
11- statistic_index_subscription . update! ( label : nil , label_i18n_path : 'statistics.subscriptions' )
10+ if StatisticIndex . count > 0
11+ statistic_index_subscription = StatisticIndex . find_by! ( es_type_key : 'subscription' )
12+ statistic_index_subscription . update! ( label : nil , label_i18n_path : 'statistics.subscriptions' )
1213
13- statistic_index_machine = StatisticIndex . find_by! ( es_type_key : 'machine' )
14- statistic_index_machine . update! ( label : nil , label_i18n_path : 'statistics.machines_hours' )
14+ statistic_index_machine = StatisticIndex . find_by! ( es_type_key : 'machine' )
15+ statistic_index_machine . update! ( label : nil , label_i18n_path : 'statistics.machines_hours' )
1516
16- statistic_index_training = StatisticIndex . find_by! ( es_type_key : 'training' )
17- statistic_index_training . update! ( label : nil , label_i18n_path : 'statistics.trainings' )
17+ statistic_index_training = StatisticIndex . find_by! ( es_type_key : 'training' )
18+ statistic_index_training . update! ( label : nil , label_i18n_path : 'statistics.trainings' )
1819
19- statistic_index_event = StatisticIndex . find_by! ( es_type_key : 'event' )
20- statistic_index_event . update! ( label : nil , label_i18n_path : 'statistics.events' )
20+ statistic_index_event = StatisticIndex . find_by! ( es_type_key : 'event' )
21+ statistic_index_event . update! ( label : nil , label_i18n_path : 'statistics.events' )
2122
22- statistic_index_account = StatisticIndex . find_by! ( es_type_key : 'account' )
23- statistic_index_account . update! ( label : nil , label_i18n_path : 'statistics.registrations' )
23+ statistic_index_account = StatisticIndex . find_by! ( es_type_key : 'account' )
24+ statistic_index_account . update! ( label : nil , label_i18n_path : 'statistics.registrations' )
2425
25- statistic_index_project = StatisticIndex . find_by! ( es_type_key : 'project' )
26- statistic_index_project . update! ( label : nil , label_i18n_path : 'statistics.projects' )
26+ statistic_index_project = StatisticIndex . find_by! ( es_type_key : 'project' )
27+ statistic_index_project . update! ( label : nil , label_i18n_path : 'statistics.projects' )
2728
28- statistic_index_user = StatisticIndex . find_by! ( es_type_key : 'user' )
29- statistic_index_user . update! ( label : nil , label_i18n_path : 'statistics.users' )
29+ statistic_index_user = StatisticIndex . find_by! ( es_type_key : 'user' )
30+ statistic_index_user . update! ( label : nil , label_i18n_path : 'statistics.users' )
3031
31- statistic_index_space = StatisticIndex . find_by! ( es_type_key : 'space' )
32- statistic_index_space . update! ( label : nil , label_i18n_path : 'statistics.spaces' )
32+ statistic_index_space = StatisticIndex . find_by! ( es_type_key : 'space' )
33+ statistic_index_space . update! ( label : nil , label_i18n_path : 'statistics.spaces' )
3334
34- statistic_index_order = StatisticIndex . find_by! ( es_type_key : 'order' )
35- statistic_index_order . update! ( label : nil , label_i18n_path : 'statistics.orders' )
35+ statistic_index_order = StatisticIndex . find_by! ( es_type_key : 'order' )
36+ statistic_index_order . update! ( label : nil , label_i18n_path : 'statistics.orders' )
3637
37- # StatisticField
38+ # StatisticField
3839
39- if StatisticField . count > 0
40- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_subscription . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
40+ if StatisticField . count > 0
41+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_subscription . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
4142
42- StatisticField . find_by! ( key : 'spaceDates' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.space_dates' )
43- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
43+ StatisticField . find_by! ( key : 'spaceDates' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.space_dates' )
44+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
4445
45- StatisticField . find_by! ( key : 'machineDates' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.machine_dates' )
46- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
46+ StatisticField . find_by! ( key : 'machineDates' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.machine_dates' )
47+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
4748
49+ StatisticField . find_by! ( key : 'trainingId' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.training_id' )
50+ StatisticField . find_by! ( key : 'trainingDate' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.training_date' )
51+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
4852
49- StatisticField . find_by! ( key : 'trainingId' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.training_id' )
50- StatisticField . find_by! ( key : 'trainingDate' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.training_date' )
51- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
53+ StatisticField . find_by! ( key : 'name' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_name' )
54+ StatisticField . find_by! ( key : 'eventId' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_id' )
55+ StatisticField . find_by! ( key : 'eventDate' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_date' )
56+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
57+ StatisticField . find_by! ( key : 'eventTheme' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_theme' )
58+ StatisticField . find_by! ( key : 'ageRange' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.age_range' )
5259
53- StatisticField . find_by! ( key : 'name' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_name' )
54- StatisticField . find_by! ( key : 'eventId' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_id' )
55- StatisticField . find_by! ( key : 'eventDate' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_date' )
56- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
57- StatisticField . find_by! ( key : 'eventTheme' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.event_theme' )
58- StatisticField . find_by! ( key : 'ageRange' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.age_range' )
60+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_account . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
5961
60- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_account . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
62+ StatisticField . find_by! ( key : 'themes' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.themes' )
63+ StatisticField . find_by! ( key : 'components' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.components' )
64+ StatisticField . find_by! ( key : 'machines' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.machines' )
65+ StatisticField . find_by! ( key : 'status' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_status' )
66+ StatisticField . find_by! ( key : 'name' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_name' )
67+ StatisticField . find_by! ( key : 'projectUserNames' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_user_names' )
6168
62- StatisticField . find_by! ( key : 'themes' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.themes' )
63- StatisticField . find_by! ( key : 'components' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.components' )
64- StatisticField . find_by! ( key : 'machines' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.machines' )
65- StatisticField . find_by! ( key : 'status' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_status' )
66- StatisticField . find_by! ( key : 'name' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_name' )
67- StatisticField . find_by! ( key : 'projectUserNames' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.project_user_names' )
69+ StatisticField . find_by! ( key : 'userId' , statistic_index_id : statistic_index_user . id ) . update! ( label : nil , label_i18n_path : 'statistics.user_id' )
6870
69- StatisticField . find_by! ( key : 'userId' , statistic_index_id : statistic_index_user . id ) . update! ( label : nil , label_i18n_path : 'statistics.user_id' )
71+ StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_order . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
72+ end
7073
71- StatisticField . find_by! ( key : 'groupName' , statistic_index_id : statistic_index_order . id ) . update! ( label : nil , label_i18n_path : 'statistics.group' )
72- end
73-
74- # StatisticType
75- if StatisticType . count > 0
76- StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
77- StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
74+ # StatisticType
75+ if StatisticType . count > 0
76+ StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
77+ StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_machine . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
7878
79- StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
80- StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
79+ StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
80+ StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_training . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
8181
82- StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.tickets_number' )
83- StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
82+ StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.tickets_number' )
83+ StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_event . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
8484
85- StatisticType . find_by! ( key : 'member' , statistic_index_id : statistic_index_account . id ) . update! ( label : nil , label_i18n_path : 'statistics.users' )
85+ StatisticType . find_by! ( key : 'member' , statistic_index_id : statistic_index_account . id ) . update! ( label : nil , label_i18n_path : 'statistics.users' )
8686
87- StatisticType . find_by! ( key : 'project' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.projects' )
87+ StatisticType . find_by! ( key : 'project' , statistic_index_id : statistic_index_project . id ) . update! ( label : nil , label_i18n_path : 'statistics.projects' )
8888
89- StatisticType . find_by! ( key : 'revenue' , statistic_index_id : statistic_index_user . id ) . update! ( label : nil , label_i18n_path : 'statistics.revenue' )
89+ StatisticType . find_by! ( key : 'revenue' , statistic_index_id : statistic_index_user . id ) . update! ( label : nil , label_i18n_path : 'statistics.revenue' )
9090
91- StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
92- StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
91+ StatisticType . find_by! ( key : 'booking' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.bookings' )
92+ StatisticType . find_by! ( key : 'hour' , statistic_index_id : statistic_index_space . id ) . update! ( label : nil , label_i18n_path : 'statistics.hours_number' )
9393
94- StatisticType . find_by! ( key : 'store' , statistic_index_id : statistic_index_order . id ) . update! ( label : nil , label_i18n_path : 'statistics.store' )
94+ StatisticType . find_by! ( key : 'store' , statistic_index_id : statistic_index_order . id ) . update! ( label : nil , label_i18n_path : 'statistics.store' )
95+ end
9596 end
9697
9798 # StatisticSubType
0 commit comments