We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5138cc commit 3b02a55Copy full SHA for 3b02a55
1 file changed
app/models/genome/sample_set.rb
@@ -292,13 +292,19 @@ def as_location
292
def as_location_s
293
case location_type
294
when :lat_lon
295
+ unless value.is_a?(Array) && value.all? { |i| i.is_a?(Float) }
296
+ return 'Not parsed: %s' % value.to_s
297
+ end
298
+
299
'%.4g %s %.4g %s' % [
300
value[0].abs, value[0].positive? ? 'N' : 'S',
301
value[1].abs, value[1].positive? ? 'E' : 'W'
302
]
303
when :lat
304
+ return 'Not parsed: %s' % value.to_s unless value.is_a?(Float)
305
'%.4g %s' % [value.abs, value.positive? ? 'N' : 'S']
306
when :lon
307
308
'%.4g %s' % [value.abs, value.positive? ? 'E' : 'W']
309
end
310
0 commit comments