frenzy/lib/frenzy_web/views/layout_view.ex
2020-06-07 11:23:26 -04:00

10 lines
223 B
Elixir

defmodule FrenzyWeb.LayoutView do
use FrenzyWeb, :view
alias Frenzy.{Repo, Group}
import Ecto.Query
def user_groups(user) do
Repo.all(from g in Group, where: g.user_id == ^user.id, preload: [:feeds])
end
end