apidae 1.2.24 → 1.3.0

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
- SHA256:
3
- metadata.gz: 2a717231678597e174e817b7b690bdfc27137476e3ef781954012a149e729f08
4
- data.tar.gz: 7a06fc98b8a238c2906bdb814d1f18a43acad992b46feba9e42b1d339d8773e2
2
+ SHA1:
3
+ metadata.gz: 11f5031e46f8bfa23ce228c242e023c4ebe10e0e
4
+ data.tar.gz: '0083f65ff4cfbd3f53c5a13126ca940c4be696ae'
5
5
  SHA512:
6
- metadata.gz: 62a2be17446a33688036e3fd07722d549c6f3d9659729363df005f7850b90ff63d167b05c128023b075d7a641262813044a48f3a73b09fcf5e9793bbc1f050cf
7
- data.tar.gz: 2ebd92b9cfc5231b9cee622f0121820065870c970b9cd10b219e183f770130fec07b7711afa16fe65b11eb40a6ce7100e3feb5e13d0d1a9d703b2c0cecb9b8e8
6
+ metadata.gz: 0a6544dae89ca3cee7525b37433fc6941b5ae76d720f2adce045d3357fd65efca3150885b0cb9da8234a5324218448e57545897865a77896e1bdfe7a462ab31b
7
+ data.tar.gz: 9c51ebdb6c1d9d671499fd60f086a8c43feb94a9c77d06108aa030b73d5bce00ad4fd5b58e0f5467d21a509bcc1594c2c59f6d19e4be2f61a78d76fc04037b3b
@@ -37,7 +37,7 @@ module Apidae
37
37
  def run
38
38
  success = true
39
39
  Export.pending.each do |e|
40
- success &&= import_data(e)
40
+ success &&= e.import_data
41
41
  end
42
42
  success ? head(:ok) : head(:internal_server_error)
43
43
  end
@@ -48,7 +48,7 @@ module Apidae
48
48
 
49
49
  def create
50
50
  @export = Export.new(export_params)
51
- if @export.save && import_data(@export)
51
+ if @export.save && @export.import_data
52
52
  redirect_to apidae.root_url, notice: 'Le fichier a bien été importé.'
53
53
  else
54
54
  flash.now[:alert] = "Une erreur s'est produite lors de l'import du fichier."
@@ -61,43 +61,5 @@ module Apidae
61
61
  def export_params
62
62
  params.require(:export).permit(:project_id, :file_url, :status)
63
63
  end
64
-
65
- def import_data(e)
66
- success = true
67
- begin
68
- open(e.file_url) do |f|
69
- begin
70
- FileImport.import(f, e.project_id)
71
- unless e.confirm_url.blank?
72
- uri = URI(e.confirm_url)
73
- req = Net::HTTP::Post.new(uri)
74
- Net::HTTP.start(uri.hostname, uri.port) do |http|
75
- http.request(req)
76
- end
77
- end
78
- e.update(status: Export::COMPLETE)
79
- if Rails.application.config.respond_to?(:apidae_import_callback)
80
- Rails.application.config.apidae_import_callback.call(e)
81
- end
82
- rescue Exception => ex
83
- logger.error("Failed to import export file : #{e.file_url}")
84
- logger.error("Error is : #{ex} \n#{ex.backtrace.join("\n") unless ex.backtrace.blank?}")
85
- success = false
86
- e.update(status: Export::CANCELLED)
87
- end
88
- end
89
- rescue OpenURI::HTTPError => err
90
- logger.error("Failed to download export file : #{e.file_url}")
91
- logger.error("Error is : #{err}")
92
- success = false
93
- e.update(status: Export::CANCELLED)
94
- rescue Exception => e
95
- logger.error "Failed to import file : #{e.file_url}"
96
- logger.error("Error is : #{err}")
97
- success = false
98
- e.update(status: Export::CANCELLED)
99
- end
100
- success
101
- end
102
64
  end
103
65
  end
@@ -1,6 +1,6 @@
1
1
  module Apidae
2
2
  module ApplicationHelper
3
- include Apidae::ApidaeHelper
3
+ include ApidaeHelper
4
4
 
5
5
  def apidae_user
6
6
  send(Rails.application.config.apidae_user) if Rails.application.config.respond_to?(:apidae_user)
@@ -44,7 +44,7 @@ module Apidae
44
44
  'LUNDI' => MONDAY,
45
45
  'MARDI' => TUESDAY,
46
46
  'MERCREDI' => WEDNESDAY,
47
- 'JEUDI' => THURSDAY,
47
+ 'JEUD' => THURSDAY,
48
48
  'VENDREDI' => FRIDAY,
49
49
  'SAMEDI' => SATURDAY,
50
50
  'DIMANCHE' => SUNDAY
@@ -113,7 +113,7 @@ module Apidae
113
113
  short_desc: node_value(data_hash, :descriptifCourt, *locales),
114
114
  long_desc: node_value(data_hash, :descriptifDetaille, *locales),
115
115
  theme_desc: data_hash[:descriptifsThematises].blank? ? {} : Hash[data_hash[:descriptifsThematises].map {|th| [node_id(th, :theme), node_value(th, :description, *locales)]}],
116
- private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], {LOCALE_FR => d[:libelleFr]} || node_value(d, :descriptif, *locales)]}]
116
+ private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], node_value(d, :descriptif, *locales)]}]
117
117
  }
118
118
  end
119
119
  end
@@ -151,7 +151,6 @@ module Apidae
151
151
  name: localized_value(att, :nom, locale),
152
152
  url: att[:traductionFichiers][0][:url].gsub('http:', 'https:'),
153
153
  type: att[:type],
154
- link: att[:link],
155
154
  description: localized_value(att, :legende, locale)
156
155
  }
157
156
  end
@@ -223,8 +222,6 @@ module Apidae
223
222
  loc_data[:latitude] = geoloc_details[:geoJson][:coordinates][1]
224
223
  loc_data[:longitude] = geoloc_details[:geoJson][:coordinates][0]
225
224
  end
226
- loc_data[:map_reference] = geoloc_details[:reperePlan]
227
- loc_data[:altitude] = geoloc_details[:altitude] if geoloc_details
228
225
  loc_data[:access] = node_value(geoloc_details, :complement) if geoloc_details
229
226
  loc_data[:environments] = location_hash[:environnements].map {|e| e[:id]} if location_hash[:environnements]
230
227
  end
@@ -239,7 +236,6 @@ module Apidae
239
236
  openings_desc: node_value(openings_hash, :periodeEnClair, *locales),
240
237
  openings_desc_mode: openings_hash[:periodeEnClairGenerationMode] == 'AUTOMATIQUE' ? MODE_AUTO : MODE_MANUAL,
241
238
  openings: build_openings(openings_hash, *locales),
242
- all_year_long: openings_hash[:ouvertTouteLAnnee] == 'OUVERT_TOUTE_L_ANNEE' ? 'true' : 'false',
243
239
  time_periods: lists_ids(openings_hash[:indicationsPeriode]),
244
240
  openings_extra: lists_ids(openings_hash[:ouverturesComplementaires])
245
241
  }
@@ -268,7 +264,7 @@ module Apidae
268
264
  apidae_obj.apidae_subtype = node_id(data_hash, :rubrique) if apidae_obj.apidae_type == Obj::EQU
269
265
  apidae_obj.apidae_subtype = lists_ids(data_hash[:typesHebergement]).first if apidae_obj.apidae_type == Obj::SPA
270
266
  {
271
- categories: lists_ids(data_hash[:categories], data_hash[:typesDetailles], data_hash[:activiteCategories], data_hash[:typesHabitation]),
267
+ categories: lists_ids(data_hash[:categories], data_hash[:typesDetailles], data_hash[:activiteCategories]),
272
268
  themes: lists_ids(data_hash[:themes]),
273
269
  capacity: (data_hash[:capacite] || {})
274
270
  .merge(presta_hash ? {group_min: presta_hash[:tailleGroupeMin], group_max: presta_hash[:tailleGroupeMax],
@@ -279,8 +275,7 @@ module Apidae
279
275
  (node_id(data_hash, :typeLabel) ? [node_id(data_hash, :typeLabel)] : []),
280
276
  chains: lists_ids(data_hash[:chaines]) + nodes_ids(data_hash[:chaineEtLabel]),
281
277
  area: apidae_obj.apidae_type == Obj::DOS ? data_hash.except(:classification) : node_value(data_hash, :lieuDePratique),
282
- track: apidae_obj.apidae_type == Obj::EQU ? (data_hash[:itineraire] || {}).except(:passagesDelicats) : nil,
283
- tricky_sections: apidae_obj.apidae_type == Obj::EQU ? node_value(data_hash[:itineraire], :passagesDelicats, *locales) : nil,
278
+ track: apidae_obj.apidae_type == Obj::EQU ? data_hash[:itineraire] : nil,
284
279
  products: lists_ids(data_hash[:typesProduit], data_hash[:aopAocIgps], data_hash[:specialites]),
285
280
  audience: lists_ids(prestations_hash[:typesClientele]),
286
281
  animals: {allowed: prestations_hash[:animauxAcceptes] == 'ACCEPTES', desc: node_value(prestations_hash, :descriptifAnimauxAcceptes, *locales),
@@ -322,18 +317,13 @@ module Apidae
322
317
  tags
323
318
  end
324
319
 
325
- def self.parse_booking(reservation_hash, visits_hash, *locales)
326
- booking_hash = {}
320
+ def self.parse_booking(reservation_hash, *locales)
327
321
  if reservation_hash
328
- booking_hash[:booking_desc] = node_value(reservation_hash, :complement, *locales),
329
- booking_hash[:booking_entities] = reservation_hash[:organismes]
330
- end
331
- if visits_hash
332
- booking_hash[:visits_allowed] = visits_hash[:visitable] == true
333
- booking_hash[:visits_desc] = node_value(visits_hash, :complementVisite, *locales)
334
- booking_hash[:visits_duration] = visits_hash[:dureeMoyenneVisiteIndividuelle]
322
+ {
323
+ booking_desc: node_value(reservation_hash, :complement, *locales),
324
+ booking_entities: reservation_hash[:organismes]
325
+ }
335
326
  end
336
- booking_hash
337
327
  end
338
328
 
339
329
  def self.parse_town(location_hash)
@@ -345,21 +335,10 @@ module Apidae
345
335
  end
346
336
  end
347
337
 
348
- def self.parse_entity_fields(information_hash, type_data_hash, sp_hash)
349
- entity_hash = {}
350
- if information_hash
351
- if information_hash[:structureGestion]
352
- entity_hash.merge!({entity_id: information_hash[:structureGestion][:id], service_provider_id: node_id(type_data_hash, :prestataireActivites)})
353
- end
354
-
355
- if information_hash[:informationsLegales]
356
- entity_hash.merge!({legal: information_hash[:informationsLegales]})
357
- end
358
- end
359
- if sp_hash && sp_hash[:prestataireActivites]
360
- entity_hash[:is_service_provider] = true
338
+ def self.parse_entity_fields(information_hash, type_data_hash)
339
+ if information_hash && information_hash[:structureGestion]
340
+ {entity_id: information_hash[:structureGestion][:id], service_provider_id: node_id(type_data_hash, :prestataireActivites)}
361
341
  end
362
- entity_hash
363
342
  end
364
343
 
365
344
  def self.node_id(node, key)
@@ -1,3 +1,6 @@
1
+ require 'uri'
2
+ require 'net/http'
3
+
1
4
  module Apidae
2
5
  class Export < ActiveRecord::Base
3
6
 
@@ -20,5 +23,43 @@ module Apidae
20
23
  def self.pending
21
24
  where(remote_status: 'SUCCESS', status: PENDING).order(:id)
22
25
  end
26
+
27
+ def import_data
28
+ success = true
29
+ begin
30
+ open(file_url) do |f|
31
+ begin
32
+ FileImport.import(f, project_id)
33
+ unless confirm_url.blank?
34
+ uri = URI(confirm_url)
35
+ req = Net::HTTP::Post.new(uri)
36
+ Net::HTTP.start(uri.hostname, uri.port) do |http|
37
+ http.request(req)
38
+ end
39
+ end
40
+ update(status: Export::COMPLETE)
41
+ if Rails.application.config.respond_to?(:apidae_import_callback)
42
+ Rails.application.config.apidae_import_callback.call(self)
43
+ end
44
+ rescue Exception => ex
45
+ logger.error("Failed to import export file : #{file_url}")
46
+ logger.error("Error is : #{ex} \n#{ex.backtrace.join("\n") unless ex.backtrace.blank?}")
47
+ success = false
48
+ update(status: Export::CANCELLED)
49
+ end
50
+ end
51
+ rescue OpenURI::HTTPError => err
52
+ logger.error("Failed to download export file : #{file_url}")
53
+ logger.error("Error is : #{err}")
54
+ success = false
55
+ update(status: Export::CANCELLED)
56
+ rescue Exception => e
57
+ logger.error "Failed to import file : #{e.file_url}"
58
+ logger.error("Error is : #{err}")
59
+ success = false
60
+ e.update(status: Export::CANCELLED)
61
+ end
62
+ success
63
+ end
23
64
  end
24
65
  end
@@ -30,21 +30,18 @@ module Apidae
30
30
  Town.import(zfile.read(TOWNS_FILE))
31
31
  logger.info "Completed #{Town.count} towns update"
32
32
  end
33
- ordered_files(zfile).each do |file|
33
+ zfile.each do |file|
34
34
  if file.file? && file.name.end_with?('.json')
35
35
  logger.info "Processing file : #{file.name}"
36
36
  if file.name.include?(MODIFIED_DIR)
37
37
  add_or_update_objects(zfile.read(file.name), result, project.locales, project.versions)
38
- end
39
- if file.name.include?(SELECTIONS_FILE)
40
- add_or_update_selections(project, zfile.read(file.name), result)
41
- end
42
- if file.name.include?(DELETED_FILE)
38
+ elsif file.name.include?(DELETED_FILE)
43
39
  delete_objects(zfile.read(file.name), result)
40
+ elsif file.name.include?(SELECTIONS_FILE)
41
+ add_or_update_selections(project, zfile.read(file.name), result)
44
42
  end
45
43
  end
46
44
  end
47
- project.cleanup_selections
48
45
  create(result.except(:selections)
49
46
  .merge({remote_file: (zip_file.is_a?(File) ? zip_file.path : zip_file), status: STATUS_COMPLETE, apidae_id: project_id}))
50
47
  logger.info "Import results : #{result}"
@@ -107,16 +104,12 @@ module Apidae
107
104
  end
108
105
  end
109
106
 
110
- def self.ordered_files(zfile)
111
- zfile.sort_by {|f| f.name.include?(MODIFIED_DIR) ? 0 : (f.name.include?(SELECTIONS_FILE) ? 1 : 2)}
112
- end
113
-
114
107
  def self.delete_objects(deleted_json, result)
115
108
  deleted_ids = JSON.parse(deleted_json)
116
109
  deleted_ids.each do |id|
117
110
  obj = Obj.find_by_apidae_id(id)
118
111
  if obj
119
- obj.destroy! if obj.selections.empty?
112
+ obj.destroy!
120
113
  result[:deleted] += 1
121
114
  else
122
115
  logger.info "skipping object deletion : #{id}"
@@ -170,9 +163,7 @@ module Apidae
170
163
  def self.add_or_update_selections(project, selections_json, result)
171
164
  selections_hashes = JSON.parse(selections_json, symbolize_names: true)
172
165
  deleted_ids = Selection.where(apidae_project_id: project.id).collect {|sel| sel.apidae_id}.uniq - selections_hashes.collect {|sel| sel[:id]}
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
166
+ Selection.where(apidae_id: deleted_ids).delete_all
176
167
  selections_hashes.each do |selection_data|
177
168
  logger.info "Updating selection #{selection_data[:id]}"
178
169
  Selection.add_or_update(selection_data, project.id)
@@ -7,7 +7,6 @@ module Apidae
7
7
 
8
8
  attr_accessor :locale
9
9
  attr_accessor :obj_version
10
- attr_accessor :obj_versions
11
10
 
12
11
  store_accessor :title_data, :title
13
12
  store_accessor :owner_data, :owner_name, :owner_id
@@ -15,15 +14,15 @@ module Apidae
15
14
  store_accessor :pictures_data, :pictures
16
15
  store_accessor :attachments_data, :attachments
17
16
  store_accessor :type_data, :categories, :themes, :capacity, :classification, :labels, :chains, :area, :track,
18
- :tricky_sections, :products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
19
- store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id, :is_service_provider, :legal
17
+ :products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
18
+ store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id
20
19
  store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :fax,
21
20
  :mobile_website, :shorty_url, :contacts
22
- store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments, :altitude, :map_reference
21
+ store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments
23
22
  store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
24
23
  store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra
25
24
  store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
26
- store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc, :visits_duration
25
+ store_accessor :booking_data, :booking_desc, :booking_entities
27
26
  store_accessor :tags_data, :promo, :internal, :linked
28
27
  store_accessor :version_data, :versioned_fields
29
28
 
@@ -84,7 +83,7 @@ module Apidae
84
83
  COS => {node: :informationsCommerceEtService, subtype: :commerceEtServiceType},
85
84
  DEG => {node: :informationsDegustation, subtype: :degustationType},
86
85
  DOS => {node: :informationsDomaineSkiable, subtype: :domaineSkiableType},
87
- EQU => {node: :informationsEquipement, subtype: :rubrique},
86
+ EQU => {node: :informationsEquipement, subtype: :equipementType},
88
87
  FEM => {node: :informationsFeteEtManifestation, subtype: :feteEtManifestationType},
89
88
  HCO => {node: :informationsHebergementCollectif, subtype: :hebergementCollectifType},
90
89
  HLO => {node: :informationsHebergementLocatif, subtype: :hebergementLocatifType},
@@ -101,7 +100,6 @@ module Apidae
101
100
  after_initialize do
102
101
  @locale = DEFAULT_LOCALE
103
102
  @obj_version = DEFAULT_VERSION
104
- @obj_versions = {}
105
103
  end
106
104
 
107
105
  def root_obj
@@ -113,15 +111,11 @@ module Apidae
113
111
  end
114
112
 
115
113
  def in_version(v)
116
- if v == DEFAULT_VERSION && root_obj_id.nil?
117
- @obj_version = DEFAULT_VERSION
118
- self
119
- else
120
- if @obj_versions[v].nil?
121
- @obj_versions[v] = versions.where(version: v).first
122
- end
123
- @obj_versions[v]
114
+ @cached_versions ||= {}
115
+ if @cached_versions[v].nil?
116
+ @cached_versions[v] = versions.where(version: v).first
124
117
  end
118
+ @cached_versions[v]
125
119
  end
126
120
 
127
121
  def in_locale(l)
@@ -170,7 +164,6 @@ module Apidae
170
164
  apidae_obj
171
165
  end
172
166
 
173
- # Note : overrides existing fields (not a merge)
174
167
  def self.populate_fields(apidae_obj, object_data, locales)
175
168
  type_fields = TYPES_DATA[object_data[:type]]
176
169
  apidae_obj.last_update = DateTime.parse(object_data[:gestion][:dateModification]) unless object_data[:gestion].blank?
@@ -185,12 +178,12 @@ module Apidae
185
178
  apidae_obj.town = ApidaeDataParser.parse_town(object_data[:localisation])
186
179
  apidae_obj.openings_data = ApidaeDataParser.parse_openings(object_data[:ouverture], *locales)
187
180
  apidae_obj.rates_data = ApidaeDataParser.parse_rates(object_data[:descriptionTarif], *locales)
188
- apidae_obj.booking_data = ApidaeDataParser.parse_booking(object_data[:reservation], object_data[:visites], *locales)
181
+ apidae_obj.booking_data = ApidaeDataParser.parse_booking(object_data[:reservation], *locales)
189
182
  apidae_obj.type_data = ApidaeDataParser.parse_type_data(apidae_obj, object_data[type_fields[:node]], object_data[:prestations],
190
183
  object_data[:tourismeAffaires], *locales)
191
184
  apidae_obj.pictures_data = ApidaeDataParser.parse_pictures_data(object_data[:illustrations], *locales)
192
185
  apidae_obj.attachments_data = ApidaeDataParser.parse_attachments_data(object_data[:multimedias], *locales)
193
- apidae_obj.entity_data = ApidaeDataParser.parse_entity_fields(object_data[:informations], object_data[type_fields[:node]], object_data[:informationsPrestataireActivites])
186
+ apidae_obj.entity_data = ApidaeDataParser.parse_entity_fields(object_data[:informations], object_data[type_fields[:node]])
194
187
  apidae_obj.service_data = ApidaeDataParser.parse_service_data(object_data[:prestations], object_data[type_fields[:node]])
195
188
  apidae_obj.tags_data = ApidaeDataParser.parse_tags_data(object_data[:presentation], object_data[:criteresInternes], object_data[:liens])
196
189
  apidae_obj.meta_data = object_data[:metadonnees]
@@ -20,11 +20,5 @@ module Apidae
20
20
  def versions=(values)
21
21
  self.versions_data = values.blank? ? nil : values.join('|')
22
22
  end
23
-
24
- def cleanup_selections
25
- apidae_selections.reload.each do |s|
26
- s.cleanup
27
- end
28
- end
29
23
  end
30
24
  end
@@ -10,7 +10,7 @@ module Apidae
10
10
  end
11
11
 
12
12
  def self.import(refs_json)
13
- locales = Rails.application.config.respond_to?(:apidae_locales) ? Rails.application.config.apidae_locales : [DEFAULT_LOCALE]
13
+ locales = Rails.application.config.respond_to?(:apidae_locales) ? Rails.application.config.apidae_locales : [DEFAULT_LOCALE]
14
14
  locales_map = Hash[locales.map {|loc| ["libelle#{loc.camelize.gsub('-', '')}".to_sym, loc]}]
15
15
  refs_hashes = JSON.parse(refs_json, symbolize_names: true)
16
16
  if refs_hashes.length != where("apidae_type != ?", INTERNAL).count
@@ -42,20 +42,6 @@ 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
-
59
45
  def results(where_clause, offset, size)
60
46
  objects.includes(:town).limit(size).offset(offset).where(where_clause)
61
47
  end
@@ -106,7 +92,6 @@ module Apidae
106
92
  query_api(query_args, true, false)
107
93
  end
108
94
 
109
- # Note : WARNING - updated obj will only contain the provided fields
110
95
  def add_or_refresh_obj(apidae_obj_id, fields = ["@all"])
111
96
  if valid_api?
112
97
  res = api_object(apidae_obj_id, fields)
@@ -117,7 +102,6 @@ module Apidae
117
102
  end
118
103
  end
119
104
 
120
- # Note : WARNING - updated objs will only contain the provided fields
121
105
  def add_or_refresh_objs(fields = ["@all"])
122
106
  if valid_api?
123
107
  res = api_objects({fields: fields})
@@ -8,10 +8,9 @@ module Apidae
8
8
  LOCALE_ZH = 'zh'
9
9
  LOCALE_ES = 'es'
10
10
  LOCALE_PT_BR = 'pt-BR'
11
- LOCALE_JP = 'jp'
12
11
 
13
12
  DEFAULT_LOCALE = LOCALE_FR
14
- ALL_LOCALES = [LOCALE_FR, LOCALE_EN, LOCALE_IT, LOCALE_DE, LOCALE_NL, LOCALE_RU, LOCALE_ZH, LOCALE_ES, LOCALE_PT_BR, LOCALE_JP]
13
+ ALL_LOCALES = [LOCALE_FR, LOCALE_EN, LOCALE_IT, LOCALE_DE, LOCALE_NL, LOCALE_RU, LOCALE_ZH, LOCALE_ES, LOCALE_PT_BR]
15
14
 
16
15
  STANDARD_VERSION = 'STANDARD'
17
16
  WINTER_VERSION = 'HIVER'
@@ -25,11 +24,8 @@ module Apidae
25
24
  ALL_VERSIONS = [STANDARD_VERSION, WINTER_VERSION, SUMMER_VERSION, CHALLENGED_VERSION, BUSINESS_VERSION,
26
25
  GROUPS_VERSION, ACTIVITIES_VERSION]
27
26
 
28
- LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments,
29
- :openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
30
- ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website,
31
- :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
32
- :openings, :openings_extra, :rates, :services, :payment_methods, :categories, :themes,
33
- :labels, :chains, :classification, :challenged, :environments, :languages, :products,
34
- :animals, :equipments, :comfort, :activities, :promo, :internal, :linked]
27
+ LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments, :openings_desc, :rates_desc,
28
+ :includes, :excludes, :extra, :booking_desc]
29
+ ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website, :services,
30
+ :equipments, :comfort, :activities, :promo, :internal, :linked]
35
31
  end
@@ -41,7 +41,6 @@ fr:
41
41
  ru: Russe
42
42
  zh: Chinois
43
43
  'pt-BR': Brésilien
44
- jp: Japonais
45
44
  versions:
46
45
  STANDARD: Standard
47
46
  HIVER: Hiver
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.2.24"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_05_28_101957) do
13
+ ActiveRecord::Schema.define(version: 2020_05_22_124205) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -92,10 +92,8 @@ ActiveRecord::Schema.define(version: 2020_05_28_101957) do
92
92
  t.datetime "created_at", null: false
93
93
  t.datetime "updated_at", null: false
94
94
  t.jsonb "meta_data"
95
- t.boolean "is_active"
96
95
  t.index ["apidae_id"], name: "index_apidae_references_on_apidae_id"
97
96
  t.index ["apidae_type"], name: "index_apidae_references_on_apidae_type"
98
- t.index ["is_active"], name: "index_apidae_references_on_is_active"
99
97
  end
100
98
 
101
99
  create_table "apidae_selection_objects", force: :cascade do |t|