apidae 2.0.3 → 2.0.5
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/apidae_data_parser.rb +1 -1
- data/app/models/apidae/export.rb +1 -1
- data/app/models/apidae/selection.rb +2 -2
- data/db/migrate/20250323184827_change_obj_certifications_structure.rb +15 -0
- data/lib/apidae/version.rb +1 -1
- data/test/dummy/log/development.log +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 876cc230ecafe34a00f73ff1dd29d5e39436c5c5c119ef8ecabfdde8312d6e02
|
4
|
+
data.tar.gz: aa52eae548c0e107ee5627389a000e9a537cb1913332f0640378289eccdab957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85be12808cd6db3da5a8d05fc39540ac1ab297802f75e879626fd18813e4db79fecb53fe3b4e9088a59a85d5e16ab1c2b2ea5b8f423cd0b3e05e4ac4e3c7126a
|
7
|
+
data.tar.gz: 651a925bf33e2339317b9175cf1bdc28b2718f332e5db86e77f4b9ec375da87c19f5e16a99289569e63f0652a12114dfd4123b2c17dbd1a896a3af7590e14f65
|
@@ -279,7 +279,7 @@ module Apidae
|
|
279
279
|
desc: node_value(prestations_hash, :descriptifAnimauxAcceptes, *locales), fee: prestations_hash[:animauxAcceptesSupplement] == 'AVEC_SUPPLEMENT'},
|
280
280
|
extra: apidae_obj.apidae_type == Obj::SPA ? node_value(data_hash, :formuleHebergement, *locales) : node_value(prestations_hash, :complementAccueil, *locales),
|
281
281
|
duration: apidae_obj.apidae_type == Obj::SPA ? {days: data_hash[:nombreJours], nights: data_hash[:nombreNuits]} : data_hash[:dureeSeance],
|
282
|
-
certifications: data_hash[:agrements].blank? ?
|
282
|
+
certifications: data_hash[:agrements].blank? ? {} : Hash[data_hash[:agrements].map {|a| [a[:type][:id].to_s, a[:numero]]}],
|
283
283
|
business: (business_hash || {}).except(:sallesEquipeesPour, :sallesEquipement, :sallesRestauration, :sallesReunion, :sallesHebergement),
|
284
284
|
business_equipments: lists_ids((business_hash || {})[:sallesEquipeesPour], (business_hash || {})[:sallesEquipement],
|
285
285
|
(business_hash || {})[:sallesRestauration], (business_hash || {})[:sallesHebergement]),
|
data/app/models/apidae/export.rb
CHANGED
@@ -40,7 +40,7 @@ module Apidae
|
|
40
40
|
|
41
41
|
removed_ids = Obj.where(apidae_id: removed).map {|o| o.id}
|
42
42
|
SelectionObject.where(apidae_selection_id: apidae_sel.id, apidae_object_id: removed_ids).delete_all
|
43
|
-
if added.any? || removed.any? || (apidae_sel.objects.maximum(:updated_at) > apidae_sel.updated_at)
|
43
|
+
if added.any? || removed.any? || (apidae_sel.objects.any? && apidae_sel.objects.maximum(:updated_at) > apidae_sel.updated_at)
|
44
44
|
apidae_sel.touch
|
45
45
|
end
|
46
46
|
end
|
@@ -224,7 +224,7 @@ module Apidae
|
|
224
224
|
response = ''
|
225
225
|
query = JSON.generate args.except(:url)
|
226
226
|
logger.debug "Apidae API query : #{args[:url]}?query=#{query}"
|
227
|
-
open("#{args[:url]}?query=#{CGI.escape query}") { |f|
|
227
|
+
URI.open("#{args[:url]}?query=#{CGI.escape query}") { |f|
|
228
228
|
f.each_line {|line| response += line if line}
|
229
229
|
}
|
230
230
|
response
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class ChangeObjCertificationsStructure < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
blank_objs = Apidae::Obj.where("type_data->'certifications'->0->>'id' IS NULL")
|
4
|
+
set_objs = Apidae::Obj.where("type_data->'certifications'->0->>'id' IS NOT NULL")
|
5
|
+
|
6
|
+
blank_objs.update_all("type_data = jsonb_set(type_data, '{certifications}', '{}'::jsonb)")
|
7
|
+
|
8
|
+
set_objs.each do |o|
|
9
|
+
unless o.certifications.is_a?(Hash)
|
10
|
+
o.certifications = o.certifications.blank? ? {} : Hash[o.certifications.map {|c| [c['id'].to_s, c['identifier']]}]
|
11
|
+
o.save!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/apidae/version.rb
CHANGED
@@ -13845,3 +13845,10 @@ Migrating to MigrateLocalizedApidaeObjFields (20190127210921)
|
|
13845
13845
|
[1m[36mApidae::Obj Load (2.4ms)[0m [1m[34mSELECT "apidae_objs".* FROM "apidae_objs" WHERE "apidae_objs"."root_obj_id" IS NULL[0m
|
13846
13846
|
[1m[36mTRANSACTION (0.8ms)[0m [1m[31mROLLBACK[0m
|
13847
13847
|
[1m[35m (0.5ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
13848
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
13849
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.9ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
13850
|
+
[1m[36mActiveRecord::InternalMetadata Load (2.2ms)[0m [1m[34mSELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1[0m [[nil, "environment"]]
|
13851
|
+
Migrating to MigrateLocalizedApidaeReferences (20190127213602)
|
13852
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mBEGIN[0m
|
13853
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mROLLBACK[0m
|
13854
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
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: 2.0.
|
4
|
+
version: 2.0.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: 2025-
|
11
|
+
date: 2025-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -213,6 +213,7 @@ files:
|
|
213
213
|
- db/migrate/20250130120941_add_tsv_column_to_pg_search_documents.rb
|
214
214
|
- db/migrate/20250130152441_add_gin_index_to_pg_search_documents.rb
|
215
215
|
- db/migrate/20250318152322_alter_tsv_column_in_pg_search_documents.rb
|
216
|
+
- db/migrate/20250323184827_change_obj_certifications_structure.rb
|
216
217
|
- lib/apidae.rb
|
217
218
|
- lib/apidae/engine.rb
|
218
219
|
- lib/apidae/version.rb
|