2019-02-11 17:22:35 -05:00
|
|
|
defmodule FrenzyWeb.LayoutView do
|
|
|
|
use FrenzyWeb, :view
|
2020-06-07 11:14:01 -04:00
|
|
|
alias Frenzy.{Repo, Group}
|
2019-11-09 13:21:45 -05:00
|
|
|
import Ecto.Query
|
|
|
|
|
|
|
|
def user_groups(user) do
|
|
|
|
Repo.all(from g in Group, where: g.user_id == ^user.id, preload: [:feeds])
|
|
|
|
end
|
2019-02-11 17:22:35 -05:00
|
|
|
end
|