Skip to content

Commit

Permalink
added back get_suits_from_selected_deck in cornucopia
Browse files Browse the repository at this point in the history
  • Loading branch information
ZabGo committed Jul 10, 2024
1 parent eea5981 commit 4f44289
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/copi/cornucopia.ex
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ defmodule Copi.Cornucopia do
def change_game(%Game{} = game, attrs \\ %{}) do
Game.changeset(game, attrs)
end

def get_suits_from_selected_deck(selected_edition) do
database_query = from c in Card,
where: c.edition == ^selected_edition,
select: c.category,
distinct: true

Enum.reduce(["Wild Card", "WILD CARD"], Repo.all(database_query), fn item, acc ->
List.delete(acc, item)
end)
end

@doc """
Returns the list of players.
Expand Down

0 comments on commit 4f44289

Please sign in to comment.