From 27d294ba6dd5c18c84f1179c2d6a3d5b1708b8be Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 9 Jul 2018 15:23:18 +0200 Subject: [PATCH] Credo fixes Signed-off-by: Thomas Citharel --- lib/eventos/events/events.ex | 2 +- lib/eventos_web/controllers/event_controller.ex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eventos/events/events.ex b/lib/eventos/events/events.ex index 3a52823c1..c3010184d 100644 --- a/lib/eventos/events/events.ex +++ b/lib/eventos/events/events.ex @@ -57,7 +57,7 @@ defmodule Eventos.Events do import Geo.PostGIS - def find_close_events(lon, lat, radius \\ 50000) do # 50 000 meters -> 50 kms + def find_close_events(lon, lat, radius \\ 50_000) do # 50 000 meters -> 50 kms ip_point = Geo.WKT.decode("SRID=4326;POINT(#{lon} #{lat})") Repo.all( from e in Event, diff --git a/lib/eventos_web/controllers/event_controller.ex b/lib/eventos_web/controllers/event_controller.ex index ad40c6dd3..516a044fb 100644 --- a/lib/eventos_web/controllers/event_controller.ex +++ b/lib/eventos_web/controllers/event_controller.ex @@ -19,8 +19,8 @@ defmodule EventosWeb.EventController do Logger.debug(inspect city) Logger.debug(inspect [latitude, longitude]) distance = case city do - nil -> 500000 - _ -> 50000 + nil -> 500_000 + _ -> 50_000 end events = Events.find_close_events(longitude, latitude, distance) render(conn, "index.json", events: events, coord: %{longitude: longitude, latitude: latitude, distance: distance}, city: city, country: country)