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