apidae 1.4.9 → 1.4.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bbdf35cd06b96fee3b3e64970262c2f424d204c6471fb3bd26e16704d9a033c
4
- data.tar.gz: caa1504d94682ee3ed80777d24955084fec7a045e41870e2759c9dfbcaa511a6
3
+ metadata.gz: 888e0fd527adf524161869a23c4eb5380c2cabaf3003949da01c9a456a7ff5ba
4
+ data.tar.gz: a7eaf735026fd06ac1e13e7fc5744a3a3f65e510a63703ee11f405e62c3c79b0
5
5
  SHA512:
6
- metadata.gz: '08456092efcc2417bef00d40d0e5898cf088617f4dc04500180a713d71ec4b052f0b0292adb3407e63c94ed5e5647ce141380389760bf544ed8e63b4475b1bc3'
7
- data.tar.gz: a42b55b7a83b89c6859d436f7b45d5b4098ad5234fc559969e1a967aec94145e6de3ecd551a88da0aefed999843a1a58ee4c2c0fecf334b25bbc540975d6d090
6
+ metadata.gz: 2a3e79a187ed0d407afdadcaacb19dcc253cca5679cafbf7974053c2f9c83f399def0aad1cb38dd3282da0fb5e6385ec44fccc9932437b920fed7200293d59f8
7
+ data.tar.gz: db4f4b1574b7ddc159861271aab03805cfe5d23683afa8faf767c89367ccdc4ef31c165b8e615c9f5fbf4276eb636f4758f003224edc19575601eb9dcbbae954
@@ -12,9 +12,9 @@ module Apidae
12
12
  def self.import(refs_json)
13
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
- if count == 0 || Time.current > (maximum(:updated_at) + 1.day)
15
+ if count == 0 || Time.current > (unscoped.maximum(:updated_at) + 1.day)
16
16
  refs_hashes = JSON.parse(refs_json, symbolize_names: true)
17
- if refs_hashes.length != where("apidae_type != ?", INTERNAL).count
17
+ if refs_hashes.length != unscoped.where("apidae_type != ?", INTERNAL).count
18
18
  refs_hashes.each do |ref_data|
19
19
  ref = Reference.unscoped.find_or_initialize_by(apidae_id: ref_data[:id], apidae_type: ref_data[:elementReferenceType])
20
20
  ref.label_data = ref_data.slice(*locales_map.keys).transform_keys {|k| locales_map[k]}
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.4.9"
2
+ VERSION = "1.4.10"
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.4.9
4
+ version: 1.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain