apidae 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3df5740373cfa229b7411e21a55eae04df831561
4
- data.tar.gz: ec010b9d61a4cea4fa552180531f606498e04231
3
+ metadata.gz: d1f8d7ad0798847cc0b3882958e5f557f1f01219
4
+ data.tar.gz: 94d139b245115c273ec4c73b385c380bf816da87
5
5
  SHA512:
6
- metadata.gz: 141dca6a42911917ad0722772df54b4f542364de8fe1502586e6710d9a37b0ade5cddd9abf5994b6768d8597b66fe3627f4fa3068d8d8da7506a4f899fa34737
7
- data.tar.gz: 17f51ee8066cd53f353bf91f395191bb78255343f65f7978ff01e56c27b9205d91203687ad0c7b4b234cb05b88116decba24df1eba317b51d52992a9baa9495e
6
+ metadata.gz: 47dea0045600b59233e78a4616396aee8341de70e9121a335741fbe66d39ffea03e18503564a83c4cd9fe496ebe7058b7ba13690c902f794f46967146d65b16d
7
+ data.tar.gz: 2350154e37a3fac1d56eed268eb322309842fcf8b349c2e2b28c63af4605aa3cb15c1b629f31a60d740ffe6ec6b9778e9c2a9ae4f03414ae9c86a3023661c719
@@ -44,7 +44,7 @@ module Apidae
44
44
  'LUNDI' => MONDAY,
45
45
  'MARDI' => TUESDAY,
46
46
  'MERCREDI' => WEDNESDAY,
47
- 'JEUD' => THURSDAY,
47
+ 'JEUDI' => THURSDAY,
48
48
  'VENDREDI' => FRIDAY,
49
49
  'SAMEDI' => SATURDAY,
50
50
  'DIMANCHE' => SUNDAY
@@ -69,7 +69,7 @@ module Apidae
69
69
  key = cache_key(:agenda, from, to)
70
70
  res = $apidae_cache.read(key)
71
71
  unless res
72
- query_args = build_args(AGENDA_ENDPOINT, {selection_ids: [apidae_id], from: from, to: to})
72
+ query_args = build_args(AGENDA_ENDPOINT, {selection_ids: [apidae_id], from: from, to: to, count: 200})
73
73
  res = query_api(query_args, true)
74
74
  $apidae_cache.write(key, res)
75
75
  end
@@ -142,14 +142,15 @@ module Apidae
142
142
 
143
143
  if all_results
144
144
  loops = 0
145
+ max_loops = only_ids ? 50 : MAX_LOOPS
145
146
  query_args[:first] = 0
146
- query_args[:count] = MAX_COUNT
147
+ query_args[:count] ||= MAX_COUNT
147
148
  query_args[:locales] ||= apidae_project && !apidae_project.locales.blank? ? apidae_project.locales : [DEFAULT_LOCALE]
148
149
  response = JSON.parse get_response(query_args), symbolize_names: false
149
150
  total = response['numFound']
150
151
  query_result[:results] = (only_ids ? response['objetTouristiqueIds'] : response['objetsTouristiques']) || {}
151
152
 
152
- while total > results_count(query_result) && loops < MAX_LOOPS
153
+ while total > results_count(query_result) && loops < max_loops
153
154
  loops += 1
154
155
  query_args[:first] += MAX_COUNT
155
156
  response = JSON.parse get_response(query_args), symbolize_names: false
@@ -5,6 +5,7 @@ module Apidae
5
5
  territories_hashes.each do |t_data|
6
6
  t = Territory.find_or_initialize_by(apidae_id: t_data[:id])
7
7
  t.name = t_data.dig(:nom, :libelleFr)
8
+
8
9
  t.save!
9
10
  end
10
11
  end
@@ -0,0 +1,5 @@
1
+ class AddApidaeTypeToApidaeTerritories < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :apidae_territories, :apidae_type, :integer
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -65,3 +65,5 @@ Migrating to AddLocalesDataToApidaeProjects (20190123214635)
65
65
   (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
66
66
  Apidae::Obj Load (26.8ms) SELECT apidae_id, COUNT(id) FROM "apidae_objs" WHERE "apidae_objs"."root_obj_id" IS NULL GROUP BY "apidae_objs"."apidae_id" HAVING (COUNT(id) > 1)
67
67
  Apidae::Obj Load (2.4ms) SELECT apidae_id, COUNT(id) FROM "apidae_objs" WHERE "apidae_objs"."root_obj_id" IS NULL GROUP BY "apidae_objs"."apidae_id" HAVING (COUNT(id) > 1)
68
+ Apidae::Obj Load (0.8ms) SELECT "apidae_objs".* FROM "apidae_objs" ORDER BY "apidae_objs"."id" ASC LIMIT $1 [["LIMIT", 1]]
69
+  (3.4ms) SELECT COUNT(*) FROM "apidae_objs"
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.2
4
+ version: 1.3.3
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: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -190,6 +190,7 @@ files:
190
190
  - db/migrate/20200522124205_rename_objs_contact_to_contact_data.rb
191
191
  - db/migrate/20200528101957_add_is_active_to_apidae_references.rb
192
192
  - db/migrate/20201112080847_create_apidae_territories.rb
193
+ - db/migrate/20210607214647_add_apidae_type_to_apidae_territories.rb
193
194
  - lib/apidae.rb
194
195
  - lib/apidae/engine.rb
195
196
  - lib/apidae/version.rb