apidae 1.4.9 → 1.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/apidae/reference.rb +2 -2
- data/lib/apidae/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888e0fd527adf524161869a23c4eb5380c2cabaf3003949da01c9a456a7ff5ba
|
4
|
+
data.tar.gz: a7eaf735026fd06ac1e13e7fc5744a3a3f65e510a63703ee11f405e62c3c79b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]}
|
data/lib/apidae/version.rb
CHANGED