From d7b6e57e26a8679d9042a6a93d8829942a4bee5e Mon Sep 17 00:00:00 2001 From: KaylaBrady <31781298+KaylaBrady@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:02:10 -0500 Subject: [PATCH] style: appease credo --- lib/mbta_v3_api/store/alerts.ex | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/mbta_v3_api/store/alerts.ex b/lib/mbta_v3_api/store/alerts.ex index 364e64e..21b43b2 100644 --- a/lib/mbta_v3_api/store/alerts.ex +++ b/lib/mbta_v3_api/store/alerts.ex @@ -76,7 +76,7 @@ defmodule MBTAV3API.Store.Alerts.Impl do } end - # Conver the struct to a record for ETS + # override alert 611483 behavior to temporarily address GL Park St alert boundary issue defp to_record( %Alert{ id: "611483" @@ -85,16 +85,10 @@ defmodule MBTAV3API.Store.Alerts.Impl do entities = alert.informed_entity |> Enum.reject(fn entity -> - entity.stop == "70196" && entity.route != "Green-B" - end) - |> Enum.reject(fn entity -> - entity.stop == "70197" && entity.route != "Green-C" - end) - |> Enum.reject(fn entity -> - entity.stop == "70198" && entity.route != "Green-D" - end) - |> Enum.reject(fn entity -> - entity.stop == "70199" && entity.route != "Green-E" + (entity.stop == "70196" && entity.route != "Green-B") || + (entity.stop == "70197" && entity.route != "Green-C") || + (entity.stop == "70198" && entity.route != "Green-D") || + (entity.stop == "70199" && entity.route != "Green-E") end) { @@ -103,6 +97,7 @@ defmodule MBTAV3API.Store.Alerts.Impl do } end + # Convert the struct to a record for ETS defp to_record( %Alert{ id: id