frenzy/lib/frenzy_web/views/layout_view.ex

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