Change summary
lib/area_code_repo.rb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Detailed changes
@@ -12,14 +12,13 @@ class AreaCodeRepo
def find(q, limit: 3)
@geo_code_repo.find(q).then { |geo|
+ log.debug "AreaCodeRepo#find(#{q.inspect})"
@db.query_defer(<<~SQL, [geo.country, geo.sql_point, limit])
SELECT area_code FROM area_codes
WHERE country=$1
ORDER BY location <-> $2
LIMIT $3
SQL
- }.then { |rows|
- rows.map { |row| row["area_code"] }
- }
+ }.then { |rows| rows.map { |row| row["area_code"] } }
end
end