apidae 0.9.30 → 0.9.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/app/models/apidae/file_import.rb +16 -6
- data/app/models/apidae/obj.rb +7 -1
- data/app/models/apidae/project.rb +6 -0
- data/app/models/apidae/selection.rb +14 -0
- data/lib/apidae/version.rb +1 -1
- data/test/data/shared_selections.json +15 -0
- data/test/dummy/log/development.log +216 -69
- data/test/dummy/log/test.log +658 -3302
- data/test/models/apidae/file_import_test.rb +23 -0
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 338dc91da5e5d118acf5d7a99e663efde7abb0a637c3bd6177a55fc5dd56018e
|
|
4
|
+
data.tar.gz: 336cdfcbf340da8a69defc71344375a8788c7355a1916329a7dc33fb8471f982
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4603b8e4a0b0aa0a38ecb67327e1b7b510f6d7197b12537e4e863366bacc46aa06f579ff3053b8f115343a249750910cc553420a2172d6c52dc396c054c4fbba
|
|
7
|
+
data.tar.gz: 56d3b98b1be6f3652e935d28f5ef66ed10dffb6bb075a485173604c7d379bbf69c213958e0563e3a06388f93033c398ec2c26c06f4032f19adeb451baa4f2cc8
|
|
@@ -30,18 +30,22 @@ module Apidae
|
|
|
30
30
|
Town.import(zfile.read(TOWNS_FILE))
|
|
31
31
|
logger.info "Completed #{Town.count} towns update"
|
|
32
32
|
end
|
|
33
|
-
zfile.each do |file|
|
|
33
|
+
ordered_files(zfile).each do |file|
|
|
34
|
+
puts "processing #{file.name}"
|
|
34
35
|
if file.file? && file.name.end_with?('.json')
|
|
35
36
|
logger.info "Processing file : #{file.name}"
|
|
36
37
|
if file.name.include?(MODIFIED_DIR)
|
|
37
38
|
add_or_update_objects(zfile.read(file.name), result, project.locales, project.versions)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
elsif file.name.include?(SELECTIONS_FILE)
|
|
39
|
+
end
|
|
40
|
+
if file.name.include?(SELECTIONS_FILE)
|
|
41
41
|
add_or_update_selections(project, zfile.read(file.name), result)
|
|
42
42
|
end
|
|
43
|
+
if file.name.include?(DELETED_FILE)
|
|
44
|
+
delete_objects(zfile.read(file.name), result)
|
|
45
|
+
end
|
|
43
46
|
end
|
|
44
47
|
end
|
|
48
|
+
project.cleanup_selections
|
|
45
49
|
create(result.except(:selections)
|
|
46
50
|
.merge({remote_file: (zip_file.is_a?(File) ? zip_file.path : zip_file), status: STATUS_COMPLETE, apidae_id: project_id}))
|
|
47
51
|
logger.info "Import results : #{result}"
|
|
@@ -104,12 +108,16 @@ module Apidae
|
|
|
104
108
|
end
|
|
105
109
|
end
|
|
106
110
|
|
|
111
|
+
def self.ordered_files(zfile)
|
|
112
|
+
zfile.sort_by {|f| f.name.include?(MODIFIED_DIR) ? 0 : (f.name.include?(SELECTIONS_FILE) ? 1 : 2)}
|
|
113
|
+
end
|
|
114
|
+
|
|
107
115
|
def self.delete_objects(deleted_json, result)
|
|
108
116
|
deleted_ids = JSON.parse(deleted_json)
|
|
109
117
|
deleted_ids.each do |id|
|
|
110
118
|
obj = Obj.find_by_apidae_id(id)
|
|
111
119
|
if obj
|
|
112
|
-
obj.destroy!
|
|
120
|
+
obj.destroy! if obj.selections.empty?
|
|
113
121
|
result[:deleted] += 1
|
|
114
122
|
else
|
|
115
123
|
logger.info "skipping object deletion : #{id}"
|
|
@@ -163,7 +171,9 @@ module Apidae
|
|
|
163
171
|
def self.add_or_update_selections(project, selections_json, result)
|
|
164
172
|
selections_hashes = JSON.parse(selections_json, symbolize_names: true)
|
|
165
173
|
deleted_ids = Selection.where(apidae_project_id: project.id).collect {|sel| sel.apidae_id}.uniq - selections_hashes.collect {|sel| sel[:id]}
|
|
166
|
-
Selection.where(apidae_id: deleted_ids).
|
|
174
|
+
apidae_selection_ids = Selection.where(apidae_id: deleted_ids).map {|s| s.id}
|
|
175
|
+
SelectionObject.where(apidae_selection_id: apidae_selection_ids).delete_all
|
|
176
|
+
Selection.where(id: apidae_selection_ids).delete_all
|
|
167
177
|
selections_hashes.each do |selection_data|
|
|
168
178
|
logger.info "Updating selection #{selection_data[:id]}"
|
|
169
179
|
Selection.add_or_update(selection_data, project.id)
|
data/app/models/apidae/obj.rb
CHANGED
|
@@ -293,12 +293,18 @@ module Apidae
|
|
|
293
293
|
when PHONE
|
|
294
294
|
contact_details[:telephone] ||= []
|
|
295
295
|
contact_details[:telephone] << c[:coordonnees][:fr]
|
|
296
|
+
contact_details[:telephone_details] ||= []
|
|
297
|
+
contact_details[:telephone_details] << {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
|
|
296
298
|
when EMAIL
|
|
297
299
|
contact_details[:email] ||= []
|
|
298
300
|
contact_details[:email] << c[:coordonnees][:fr]
|
|
301
|
+
contact_details[:email_details] ||= []
|
|
302
|
+
contact_details[:email_details] << {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
|
|
299
303
|
when WEBSITE
|
|
300
304
|
contact_details[:website] ||= []
|
|
301
305
|
contact_details[:website] << c[:coordonnees][:fr]
|
|
306
|
+
contact_details[:website_details] ||= []
|
|
307
|
+
contact_details[:website_details] << {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
|
|
302
308
|
else
|
|
303
309
|
end
|
|
304
310
|
end
|
|
@@ -419,7 +425,7 @@ module Apidae
|
|
|
419
425
|
end
|
|
420
426
|
unless linked_data_hash.blank? || linked_data_hash[:liensObjetsTouristiquesTypes].blank?
|
|
421
427
|
tags[:linked] = linked_data_hash[:liensObjetsTouristiquesTypes]
|
|
422
|
-
.map {|l| {apidae_id: l[:objetTouristique][:id], apidae_type: l[:objetTouristique][:type], category: l[:type]}}
|
|
428
|
+
.map {|l| {apidae_id: l[:objetTouristique][:id], apidae_type: l[:objetTouristique][:type], category: l[:type], name: l[:objetTouristique][:nom]}}
|
|
423
429
|
end
|
|
424
430
|
tags
|
|
425
431
|
end
|
|
@@ -42,6 +42,20 @@ module Apidae
|
|
|
42
42
|
SelectionObject.where(apidae_selection_id: apidae_sel.id, apidae_object_id: removed_ids).delete_all
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def cleanup
|
|
46
|
+
obsolete_count = apidae_selection_objects
|
|
47
|
+
.joins("LEFT JOIN apidae_objs ON apidae_objs.id = apidae_selection_objects.apidae_object_id")
|
|
48
|
+
.where("apidae_objs.id IS NULL")
|
|
49
|
+
.delete_all
|
|
50
|
+
logger.info "Cleaned up #{obsolete_count} obsolete selection-objects associations for selection #{apidae_id}"
|
|
51
|
+
|
|
52
|
+
dups = apidae_selection_objects.reload.group(:apidae_object_id)
|
|
53
|
+
.select("COUNT(id), apidae_object_id, ARRAY_AGG(id) AS so_ids")
|
|
54
|
+
.having("COUNT(id) > ?", 1).map {|so| so.so_ids}
|
|
55
|
+
dups_count = apidae_selection_objects.where(id: dups.map {|d| d.sort[1..-1]}.flatten).delete_all
|
|
56
|
+
logger.info "Cleaned up #{dups_count} duplicate selection-objects associations for selection #{apidae_id}"
|
|
57
|
+
end
|
|
58
|
+
|
|
45
59
|
def results(where_clause, offset, size)
|
|
46
60
|
objects.includes(:town).limit(size).offset(offset).where(where_clause)
|
|
47
61
|
end
|
data/lib/apidae/version.rb
CHANGED
|
@@ -1,69 +1,216 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
2
|
+
|
|
3
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
4
|
+
to be an error condition in future versions of Rails.
|
|
5
|
+
|
|
6
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
7
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
8
|
+
the expected changes won't be reflected in that stale Module object.
|
|
9
|
+
|
|
10
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
11
|
+
|
|
12
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
13
|
+
callback this way:
|
|
14
|
+
|
|
15
|
+
Rails.application.reloader.to_prepare do
|
|
16
|
+
# Autoload classes and modules needed at boot time here.
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
That block runs when the application boots, and every time there is a reload.
|
|
20
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
21
|
+
|
|
22
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
23
|
+
Rails autoloads and reloads.
|
|
24
|
+
(called from <top (required)> at /Users/jbvilain/workspace/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
25
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
26
|
+
|
|
27
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
28
|
+
to be an error condition in future versions of Rails.
|
|
29
|
+
|
|
30
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
31
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
32
|
+
the expected changes won't be reflected in that stale Module object.
|
|
33
|
+
|
|
34
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
35
|
+
|
|
36
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
37
|
+
callback this way:
|
|
38
|
+
|
|
39
|
+
Rails.application.reloader.to_prepare do
|
|
40
|
+
# Autoload classes and modules needed at boot time here.
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
That block runs when the application boots, and every time there is a reload.
|
|
44
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
45
|
+
|
|
46
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
47
|
+
Rails autoloads and reloads.
|
|
48
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
49
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
50
|
+
|
|
51
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
52
|
+
to be an error condition in future versions of Rails.
|
|
53
|
+
|
|
54
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
55
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
56
|
+
the expected changes won't be reflected in that stale Module object.
|
|
57
|
+
|
|
58
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
59
|
+
|
|
60
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
61
|
+
callback this way:
|
|
62
|
+
|
|
63
|
+
Rails.application.reloader.to_prepare do
|
|
64
|
+
# Autoload classes and modules needed at boot time here.
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
That block runs when the application boots, and every time there is a reload.
|
|
68
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
69
|
+
|
|
70
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
71
|
+
Rails autoloads and reloads.
|
|
72
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
73
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
74
|
+
|
|
75
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
76
|
+
to be an error condition in future versions of Rails.
|
|
77
|
+
|
|
78
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
79
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
80
|
+
the expected changes won't be reflected in that stale Module object.
|
|
81
|
+
|
|
82
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
83
|
+
|
|
84
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
85
|
+
callback this way:
|
|
86
|
+
|
|
87
|
+
Rails.application.reloader.to_prepare do
|
|
88
|
+
# Autoload classes and modules needed at boot time here.
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
That block runs when the application boots, and every time there is a reload.
|
|
92
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
93
|
+
|
|
94
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
95
|
+
Rails autoloads and reloads.
|
|
96
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
97
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
98
|
+
|
|
99
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
100
|
+
to be an error condition in future versions of Rails.
|
|
101
|
+
|
|
102
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
103
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
104
|
+
the expected changes won't be reflected in that stale Module object.
|
|
105
|
+
|
|
106
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
107
|
+
|
|
108
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
109
|
+
callback this way:
|
|
110
|
+
|
|
111
|
+
Rails.application.reloader.to_prepare do
|
|
112
|
+
# Autoload classes and modules needed at boot time here.
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
That block runs when the application boots, and every time there is a reload.
|
|
116
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
117
|
+
|
|
118
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
119
|
+
Rails autoloads and reloads.
|
|
120
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
121
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
122
|
+
|
|
123
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
124
|
+
to be an error condition in future versions of Rails.
|
|
125
|
+
|
|
126
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
127
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
128
|
+
the expected changes won't be reflected in that stale Module object.
|
|
129
|
+
|
|
130
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
131
|
+
|
|
132
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
133
|
+
callback this way:
|
|
134
|
+
|
|
135
|
+
Rails.application.reloader.to_prepare do
|
|
136
|
+
# Autoload classes and modules needed at boot time here.
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
That block runs when the application boots, and every time there is a reload.
|
|
140
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
141
|
+
|
|
142
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
143
|
+
Rails autoloads and reloads.
|
|
144
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
145
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
146
|
+
|
|
147
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
148
|
+
to be an error condition in future versions of Rails.
|
|
149
|
+
|
|
150
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
151
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
152
|
+
the expected changes won't be reflected in that stale Module object.
|
|
153
|
+
|
|
154
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
155
|
+
|
|
156
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
157
|
+
callback this way:
|
|
158
|
+
|
|
159
|
+
Rails.application.reloader.to_prepare do
|
|
160
|
+
# Autoload classes and modules needed at boot time here.
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
That block runs when the application boots, and every time there is a reload.
|
|
164
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
165
|
+
|
|
166
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
167
|
+
Rails autoloads and reloads.
|
|
168
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
169
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
170
|
+
|
|
171
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
172
|
+
to be an error condition in future versions of Rails.
|
|
173
|
+
|
|
174
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
175
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
176
|
+
the expected changes won't be reflected in that stale Module object.
|
|
177
|
+
|
|
178
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
179
|
+
|
|
180
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
181
|
+
callback this way:
|
|
182
|
+
|
|
183
|
+
Rails.application.reloader.to_prepare do
|
|
184
|
+
# Autoload classes and modules needed at boot time here.
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
That block runs when the application boots, and every time there is a reload.
|
|
188
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
189
|
+
|
|
190
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
191
|
+
Rails autoloads and reloads.
|
|
192
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|
|
193
|
+
DEPRECATION WARNING: Initialization autoloaded the constants Apidae::ApidaeHelper, Apidae::ApplicationHelper, Apidae::ApiHelper, Apidae::DashboardHelper, Apidae::ExtendableHelper, Apidae::ImportHelper, Apidae::ObjectsHelper, Apidae::ReferencesHelper, Apidae::SelectionsHelper, and Apidae::ApplicationController.
|
|
194
|
+
|
|
195
|
+
Being able to do this is deprecated. Autoloading during initialization is going
|
|
196
|
+
to be an error condition in future versions of Rails.
|
|
197
|
+
|
|
198
|
+
Reloading does not reboot the application, and therefore code executed during
|
|
199
|
+
initialization does not run again. So, if you reload Apidae::ApidaeHelper, for example,
|
|
200
|
+
the expected changes won't be reflected in that stale Module object.
|
|
201
|
+
|
|
202
|
+
`config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
|
|
203
|
+
|
|
204
|
+
In order to autoload safely at boot time, please wrap your code in a reloader
|
|
205
|
+
callback this way:
|
|
206
|
+
|
|
207
|
+
Rails.application.reloader.to_prepare do
|
|
208
|
+
# Autoload classes and modules needed at boot time here.
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
That block runs when the application boots, and every time there is a reload.
|
|
212
|
+
For historical reasons, it may run twice, so it has to be idempotent.
|
|
213
|
+
|
|
214
|
+
Check the "Autoloading and Reloading Constants" guide to learn more about how
|
|
215
|
+
Rails autoloads and reloads.
|
|
216
|
+
(called from <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/test/dummy/config/environment.rb:5)
|