1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/lib/chess_web/views/game_view.ex
2018-02-23 13:51:23 -05:00

14 lines
241 B
Elixir

defmodule ChessWeb.GameView do
use ChessWeb, :view
import Chess.Auth, only: [current_user: 1]
def opponent(conn, game) do
if current_user(conn).id == game.user_id do
game.opponent
else
game.user
end
end
end