From 67c2407ae48033c5c747f7475e377305e521f8d0 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Tue, 8 Aug 2023 19:46:41 +0200 Subject: [PATCH] Adding new migration and attempting to fix a bug. --- lib/BurguillosInfo/DB/Migrations.pm | 1 + lib/BurguillosInfo/Tracking.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/BurguillosInfo/DB/Migrations.pm b/lib/BurguillosInfo/DB/Migrations.pm index 6dfccca..8f8141a 100644 --- a/lib/BurguillosInfo/DB/Migrations.pm +++ b/lib/BurguillosInfo/DB/Migrations.pm @@ -39,6 +39,7 @@ sub MIGRATIONS { 'ALTER TABLE requests ADD COLUMN subdivision TEXT;', 'CREATE INDEX request_subdivision_index on requests (subdivision);', \&_populate_locations, + \&_populate_locations, ); } diff --git a/lib/BurguillosInfo/Tracking.pm b/lib/BurguillosInfo/Tracking.pm index def0d25..7079a16 100644 --- a/lib/BurguillosInfo/Tracking.pm +++ b/lib/BurguillosInfo/Tracking.pm @@ -54,8 +54,8 @@ sub _register_request_query ( $self, $remote_address, $user_agent, $params_json, $path, $referer ) { my $dbh = BurguillosInfo::DB->connect($app); - my $country = $self->_get_country('185.244.231.157'); - my $subdivision = $self->_get_subdivision('185.244.231.157'); + my $country = $self->_get_country($remote_address); + my $subdivision = $self->_get_subdivision($remote_address); $dbh->do( <<'EOF', undef, $remote_address, $user_agent, $params_json, $path, $referer, $country, $subdivision );