apidae 1.2.22 → 1.2.23
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 +4 -4
- data/app/models/apidae/file_import.rb +4 -1
- data/lib/apidae/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2407ded3bf635d320fc63285f4856a6665cf01f4bd59ffcc61dd5b4fbd5c0195
|
|
4
|
+
data.tar.gz: a6015865bc0699672c36abec0628cfc22031ab4bec70ee49a26a33134c459f9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08f5b492b0e87e04e51de3fd8f91274c89f5420648effb6a48113aa0b567ba4bf6c6041e0c7c56f2c66b6478f9cae6ce32f4af3d83f9bdd9b35a36db2d81fbef'
|
|
7
|
+
data.tar.gz: d44a1b68ac1bb5155e280f743aa985ea3487b92939f4857ce2eacb73afda126eded590ee562c768a6f64eef3ad88cc6441d2e2702d4780abfdfe4c3642bc3a1f
|
|
@@ -44,6 +44,7 @@ module Apidae
|
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
|
+
project.cleanup_selections
|
|
47
48
|
create(result.except(:selections)
|
|
48
49
|
.merge({remote_file: (zip_file.is_a?(File) ? zip_file.path : zip_file), status: STATUS_COMPLETE, apidae_id: project_id}))
|
|
49
50
|
logger.info "Import results : #{result}"
|
|
@@ -169,7 +170,9 @@ module Apidae
|
|
|
169
170
|
def self.add_or_update_selections(project, selections_json, result)
|
|
170
171
|
selections_hashes = JSON.parse(selections_json, symbolize_names: true)
|
|
171
172
|
deleted_ids = Selection.where(apidae_project_id: project.id).collect {|sel| sel.apidae_id}.uniq - selections_hashes.collect {|sel| sel[:id]}
|
|
172
|
-
Selection.where(apidae_id: deleted_ids).
|
|
173
|
+
apidae_selection_ids = Selection.where(apidae_id: deleted_ids).map {|s| s.id}
|
|
174
|
+
SelectionObject.where(apidae_selection_id: apidae_selection_ids).delete_all
|
|
175
|
+
Selection.where(id: apidae_selection_ids).delete_all
|
|
173
176
|
selections_hashes.each do |selection_data|
|
|
174
177
|
logger.info "Updating selection #{selection_data[:id]}"
|
|
175
178
|
Selection.add_or_update(selection_data, project.id)
|
data/lib/apidae/version.rb
CHANGED