Use map instead of inject
This commit is contained in:
parent
490a6dee4c
commit
c3754a173f
4 changed files with 10 additions and 10 deletions
|
@ -32,10 +32,10 @@ class ModuleApiCartoService
|
|||
end
|
||||
|
||||
def self.generate_cadastre coordinates
|
||||
(coordinates.inject([]) { |acc, coordinate|
|
||||
acc << CARTO::SGMAP::Cadastre::Adapter.new(
|
||||
coordinates.flat_map do |coordinate|
|
||||
CARTO::SGMAP::Cadastre::Adapter.new(
|
||||
coordinate.map { |element| [element['lng'], element['lat']] }
|
||||
).to_params
|
||||
}).flatten
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue