apidae 1.0.3 → 1.0.4

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: b71bd513f58e234253653471aa9a71ac9d0c2128
4
- data.tar.gz: 7564dab0a718de8e97f06bdba7373513265a1031
3
+ metadata.gz: 0603f295a6946a070d13d9a70813840de04bc155
4
+ data.tar.gz: 9e15a59b156bad347b5d0cec0625fdb6ddca2c38
5
5
  SHA512:
6
- metadata.gz: ee5d3cbb3aa547a36f7131ee07819b0daf560808a977facfc62bf9ade35f04909400b2a9ca2279b50d8b452de3bb72c6f24ebc289c0e5425c6f22d37a5d2407b
7
- data.tar.gz: 7b4466705605f967acb6026c0887c1ec00a448196d478b1ca47187701f833cb94367b338b45199a480e2f20374337ed54f4ff23e43e3a8509e29da5162bd9391
6
+ metadata.gz: 960c0cc9dcbbca0b5a290b4d44b60ca10b81271b55050d27ac6d279680d77233221720e117f5b2d7193824856e75d8cf842880625cda9d6b7a29fc94bde2b05b
7
+ data.tar.gz: 4dacb5596fad4f0824c76e1a2f4fd9f124f12399fbd753401e5ff3deea084b12ca087e83985dea9e7c5e9e3ee0725a315af69417a205ae7d8f9a186734b1e871
@@ -210,7 +210,8 @@ module Apidae
210
210
  openings_desc: node_value(openings_hash, :periodeEnClair, *locales),
211
211
  openings_desc_mode: openings_hash[:periodeEnClairGenerationMode] == 'AUTOMATIQUE' ? MODE_AUTO : MODE_MANUAL,
212
212
  openings: build_openings(openings_hash, *locales),
213
- time_periods: lists_ids(openings_hash[:indicationsPeriode])
213
+ time_periods: lists_ids(openings_hash[:indicationsPeriode]),
214
+ openings_extra: lists_ids(openings_hash[:ouverturesComplementaires])
214
215
  }
215
216
  end
216
217
  end
@@ -18,7 +18,7 @@ module Apidae
18
18
  store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id
19
19
  store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :contacts
20
20
  store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments
21
- store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods
21
+ store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
22
22
  store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes
23
23
  store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
24
24
  store_accessor :booking_data, :booking_desc, :booking_entities
@@ -5,6 +5,10 @@ module Apidae
5
5
 
6
6
  store_accessor :meta_data, :category, :parent
7
7
 
8
+ def self.default_scope
9
+ where(is_active: true)
10
+ end
11
+
8
12
  def self.import(refs_json)
9
13
  locales = Rails.application.config.respond_to?(:apidae_locales) ? Rails.application.config.apidae_locales : [DEFAULT_LOCALE]
10
14
  locales_map = Hash[locales.map {|loc| ["libelle#{loc.camelize.gsub('-', '')}".to_sym, loc]}]
@@ -15,6 +19,7 @@ module Apidae
15
19
  ref.label_data = ref_data.slice(*locales_map.keys).transform_keys {|k| locales_map[k]}
16
20
  ref.parent = ref_data[:parent][:id] if ref_data[:parent]
17
21
  ref.category = ref_data[:familleCritere] ? ref_data[:familleCritere][:id] : (ref_data[:typeLabel] ? ref_data[:typeLabel][:id] : nil)
22
+ ref.is_active = ref_data[:actif]
18
23
  ref.save!
19
24
  end
20
25
  end
@@ -0,0 +1,6 @@
1
+ class AddIsActiveToApidaeReferences < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :apidae_references, :is_active, :boolean
4
+ add_index :apidae_references, :is_active, unique: false
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
@@ -178,6 +178,7 @@ files:
178
178
  - db/migrate/20200312150008_add_version_data_to_apidae_objs.rb
179
179
  - db/migrate/20200312150904_add_version_index_on_apidae_objs.rb
180
180
  - db/migrate/20200522124205_rename_objs_contact_to_contact_data.rb
181
+ - db/migrate/20200528101957_add_is_active_to_apidae_references.rb
181
182
  - lib/apidae.rb
182
183
  - lib/apidae/engine.rb
183
184
  - lib/apidae/version.rb