apidae 1.3.0 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/config/manifest.js +1 -0
- data/app/helpers/apidae/extendable_helper.rb +4 -0
- data/app/models/apidae/apidae_data_parser.rb +24 -10
- data/app/models/apidae/file_import.rb +12 -5
- data/app/models/apidae/obj.rb +18 -11
- data/app/models/apidae/selection.rb +6 -3
- data/app/models/apidae/territory.rb +18 -0
- data/config/initializers/constants.rb +7 -3
- data/config/locales/apidae.fr.yml +1 -0
- data/db/migrate/20201112080847_create_apidae_territories.rb +10 -0
- data/db/migrate/20210607214647_add_apidae_type_to_apidae_territories.rb +5 -0
- data/lib/apidae/version.rb +1 -1
- data/test/data/shared_selections.json +15 -0
- data/test/dummy/log/development.log +283 -0
- data/test/dummy/log/test.log +5185 -0
- data/test/models/apidae/file_import_test.rb +23 -0
- metadata +10 -3
@@ -166,6 +166,29 @@ module Apidae
|
|
166
166
|
assert_equal 0, Selection.count
|
167
167
|
end
|
168
168
|
|
169
|
+
test "object deletion cancelled if used by another project" do
|
170
|
+
proj = Project.create(apidae_id: 123)
|
171
|
+
other_proj = Project.create(apidae_id: 456)
|
172
|
+
sel = Selection.create(apidae_id: 49063, apidae_project_id: proj.id, label: 'Sélection 2', reference: 'selection-2')
|
173
|
+
other_sel = Selection.create(apidae_id: 49999, apidae_project_id: other_proj.id, label: 'Sélection 99', reference: 'selection-99')
|
174
|
+
sel.objects << Obj.create(apidae_id: 503, title: 'Société des violoncellistes aixois')
|
175
|
+
sel.objects << Obj.create(apidae_id: 504, title: 'Société des contrebassistes aixois')
|
176
|
+
other_sel.objects << Obj.find_by_apidae_id(504)
|
177
|
+
|
178
|
+
assert_equal 2, sel.objects.count
|
179
|
+
assert_equal 1, other_sel.objects.count
|
180
|
+
|
181
|
+
selections_json = File.read('test/data/shared_selections.json')
|
182
|
+
FileImport.add_or_update_selections(proj, selections_json, @result)
|
183
|
+
deletion_json = File.read('test/data/deletion.json')
|
184
|
+
FileImport.delete_objects(deletion_json, @result)
|
185
|
+
|
186
|
+
assert_equal 2, Obj.count
|
187
|
+
assert_equal({created: 0, updated: 0, deleted: 1, selections:
|
188
|
+
[{:apidae_id=>49063, :reference=>"selection-2", :objects=>1}]}, @result)
|
189
|
+
assert_equal 1, other_sel.objects.count
|
190
|
+
end
|
191
|
+
|
169
192
|
test "full import process" do
|
170
193
|
Obj.create(apidae_id: 123, title: 'Objet à supprimer')
|
171
194
|
Obj.create(apidae_id: 4826186, title: 'Objet à mettre à jour')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- MIT-LICENSE
|
83
83
|
- README.rdoc
|
84
84
|
- Rakefile
|
85
|
+
- app/assets/config/manifest.js
|
85
86
|
- app/assets/images/apidae/logo-apidae-grey.svg
|
86
87
|
- app/assets/javascripts/apidae/application.js
|
87
88
|
- app/assets/stylesheets/apidae/application.css
|
@@ -97,6 +98,7 @@ files:
|
|
97
98
|
- app/helpers/apidae/apidae_helper.rb
|
98
99
|
- app/helpers/apidae/application_helper.rb
|
99
100
|
- app/helpers/apidae/dashboard_helper.rb
|
101
|
+
- app/helpers/apidae/extendable_helper.rb
|
100
102
|
- app/helpers/apidae/import_helper.rb
|
101
103
|
- app/helpers/apidae/objects_helper.rb
|
102
104
|
- app/helpers/apidae/references_helper.rb
|
@@ -110,6 +112,7 @@ files:
|
|
110
112
|
- app/models/apidae/reference.rb
|
111
113
|
- app/models/apidae/selection.rb
|
112
114
|
- app/models/apidae/selection_object.rb
|
115
|
+
- app/models/apidae/territory.rb
|
113
116
|
- app/models/apidae/town.rb
|
114
117
|
- app/views/apidae/dashboard/index.html.erb
|
115
118
|
- app/views/apidae/import/_form.html.erb
|
@@ -187,6 +190,8 @@ files:
|
|
187
190
|
- db/migrate/20200312150904_add_version_index_on_apidae_objs.rb
|
188
191
|
- db/migrate/20200522124205_rename_objs_contact_to_contact_data.rb
|
189
192
|
- db/migrate/20200528101957_add_is_active_to_apidae_references.rb
|
193
|
+
- db/migrate/20201112080847_create_apidae_territories.rb
|
194
|
+
- db/migrate/20210607214647_add_apidae_type_to_apidae_territories.rb
|
190
195
|
- lib/apidae.rb
|
191
196
|
- lib/apidae/engine.rb
|
192
197
|
- lib/apidae/version.rb
|
@@ -205,6 +210,7 @@ files:
|
|
205
210
|
- test/data/hot_fr_en.json
|
206
211
|
- test/data/json_export.zip
|
207
212
|
- test/data/selections.json
|
213
|
+
- test/data/shared_selections.json
|
208
214
|
- test/data/structure.json
|
209
215
|
- test/data/update_selections.json
|
210
216
|
- test/dummy/README.rdoc
|
@@ -281,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
287
|
version: '0'
|
282
288
|
requirements: []
|
283
289
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.6.
|
290
|
+
rubygems_version: 2.7.6.2
|
285
291
|
signing_key:
|
286
292
|
specification_version: 4
|
287
293
|
summary: A Ruby on Rails engine for projects that involve Apidae data
|
@@ -347,6 +353,7 @@ test_files:
|
|
347
353
|
- test/controllers/apidae/dashboard_controller_test.rb
|
348
354
|
- test/controllers/apidae/references_controller_test.rb
|
349
355
|
- test/controllers/apidae/import_controller_test.rb
|
356
|
+
- test/data/shared_selections.json
|
350
357
|
- test/data/equ_groups.json
|
351
358
|
- test/data/update_selections.json
|
352
359
|
- test/data/json_export.zip
|