frenzy/lib/frenzy_web/views/layout_view.ex

10 lines
229 B
Elixir

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