Carto::Geocodeur → ApiAdresse::Geocodeur
This commit is contained in:
parent
d726fbf698
commit
5e9e913dce
4 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ class Ban::SearchController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_address_point
|
def get_address_point
|
||||||
point = Carto::Geocodeur.convert_adresse_to_point(params[:request])
|
point = ApiAdresse::Geocodeur.convert_adresse_to_point(params[:request])
|
||||||
|
|
||||||
if point.present?
|
if point.present?
|
||||||
lon = point.x.to_s
|
lon = point.x.to_s
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module Carto
|
module ApiAdresse
|
||||||
# this class take a string in input and return a point
|
# this class take a string in input and return a point
|
||||||
class Geocodeur
|
class Geocodeur
|
||||||
def self.convert_adresse_to_point(address)
|
def self.convert_adresse_to_point(address)
|
|
@ -243,7 +243,7 @@ class Dossier < ApplicationRecord
|
||||||
|
|
||||||
def geo_position
|
def geo_position
|
||||||
if etablissement.present?
|
if etablissement.present?
|
||||||
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse)
|
point = ApiAdresse::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse)
|
||||||
end
|
end
|
||||||
|
|
||||||
lon = "2.428462"
|
lon = "2.428462"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Carto::Geocodeur do
|
describe ApiAdresse::Geocodeur do
|
||||||
let(:address) { '50 av des champs elysees' }
|
let(:address) { '50 av des champs elysees' }
|
||||||
describe '.convert_adresse_to_point', vcr: { cassette_name: 'api_adresse_octo' } do
|
describe '.convert_adresse_to_point', vcr: { cassette_name: 'api_adresse_octo' } do
|
||||||
it 'return a point' do
|
it 'return a point' do
|
Loading…
Reference in a new issue