From 00246edaf41a9374db6f27db8d67d55b5a6d068f Mon Sep 17 00:00:00 2001 From: Tristan Date: Sat, 3 Aug 2024 12:10:26 -0400 Subject: [PATCH] Fix uncommitted changes (#87) --- lib/lanpartyseating/logic/station_logic.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/lanpartyseating/logic/station_logic.ex b/lib/lanpartyseating/logic/station_logic.ex index b604faa..fe02c0c 100644 --- a/lib/lanpartyseating/logic/station_logic.ex +++ b/lib/lanpartyseating/logic/station_logic.ex @@ -152,14 +152,18 @@ defmodule Lanpartyseating.StationLogic do def save_station_positions(table) do Repo.delete_all(Station) + now_naive = + NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second) + positions = table |> Enum.flat_map(fn row -> row |> Enum.map(fn station_number -> - %Station{station_number: station_number, display_order: station_number} + %{station_number: station_number, display_order: station_number, inserted_at: now_naive, updated_at: now_naive} end) end) + |> IO.inspect Repo.insert_all(Station, positions) :ok