apidae 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/apidae/import_controller.rb +1 -1
- data/app/models/apidae/object.rb +16 -10
- data/lib/apidae/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87cd9a41caead065a805e975fbe7fc5f4227cfdf
|
4
|
+
data.tar.gz: bf3ac2b75b2e4a2ee96d5a0a0298ce105460afc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16697f8ea3872f0b10db80aa23df7f7e475945b56787b131d89875fdb31c4a340729376f35160fbc715af0f2da68a862c3336334a8e34fb699d3ea6fbea2f098
|
7
|
+
data.tar.gz: 89856a0a71ddf723f2a8dffd3631d9950d93523e406c63a1032bf1fdd761fb5f6310aab7440f863dbdd6ceb7b0f7803d7e8cdf00d0e24b457ef925b184f253c2
|
@@ -45,7 +45,7 @@ module Apidae
|
|
45
45
|
e.update(status: Export::COMPLETE)
|
46
46
|
rescue Exception => ex
|
47
47
|
logger.error("Failed to import export file : #{e.file_url}")
|
48
|
-
logger.error("Error is : #{ex}")
|
48
|
+
logger.error("Error is : #{ex} \n#{ex.backtrace.join("\n") unless ex.backtrace.blank?}")
|
49
49
|
success = false
|
50
50
|
end
|
51
51
|
end
|
data/app/models/apidae/object.rb
CHANGED
@@ -112,24 +112,30 @@ module Apidae
|
|
112
112
|
|
113
113
|
def self.address(address_hash)
|
114
114
|
computed_address = []
|
115
|
-
|
116
|
-
|
117
|
-
|
115
|
+
unless address_hash.blank?
|
116
|
+
computed_address << address_hash[:adresse1] unless address_hash[:adresse1].blank?
|
117
|
+
computed_address << address_hash[:adresse2] unless address_hash[:adresse2].blank?
|
118
|
+
computed_address << address_hash[:adresse3] unless address_hash[:adresse3].blank?
|
119
|
+
end
|
118
120
|
{address_fields: computed_address}
|
119
121
|
end
|
120
122
|
|
121
|
-
def self.town(address_hash)
|
122
|
-
address_hash[:commune] ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
|
123
|
+
def self.town(address_hash = {})
|
124
|
+
(!address_hash.blank? && address_hash[:commune]) ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
|
123
125
|
end
|
124
126
|
|
125
127
|
def self.latitude(location_hash)
|
126
|
-
|
127
|
-
|
128
|
+
unless location_hash.blank?
|
129
|
+
geoloc_details = location_hash[:geolocalisation]
|
130
|
+
(geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][1] : nil
|
131
|
+
end
|
128
132
|
end
|
129
133
|
|
130
|
-
def self.longitude(location_hash)
|
131
|
-
|
132
|
-
|
134
|
+
def self.longitude(location_hash = {})
|
135
|
+
unless location_hash.blank?
|
136
|
+
geoloc_details = location_hash[:geolocalisation]
|
137
|
+
(geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][0] : nil
|
138
|
+
end
|
133
139
|
end
|
134
140
|
|
135
141
|
def self.openings(openings_hash)
|
data/lib/apidae/version.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.5.1
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: A Ruby on Rails engine for projects that involve Apidae data
|