diff --git a/db/migrate/20200801230101_change_referer_to_origin.rb b/db/migrate/20200801230101_change_referer_to_origin.rb index 1a63d32..9c320c1 100644 --- a/db/migrate/20200801230101_change_referer_to_origin.rb +++ b/db/migrate/20200801230101_change_referer_to_origin.rb @@ -3,6 +3,6 @@ class ChangeRefererToOrigin < ActiveRecord::Migration[6.0] rename_column :access_logs, :http_referer, :http_origin # Eliminar todos los referers anteriores manteniendo el origin - ActiveRecord::Base.connection.execute("update access_logs set http_origin = split_part(http_origin, '/', 1) || '//' || split_part(http_origin, '/', 2) where http_origin is not null") + ActiveRecord::Base.connection.execute("update access_logs set http_origin = split_part(http_origin, '/', 1) || '//' || split_part(http_origin, '/', 3) where http_origin is not null") end end