frenzy/lib/frenzy_web/views/layout_view.ex

10 lines
229 B
Elixir
Raw Normal View History

2019-02-11 22:22:35 +00:00
defmodule FrenzyWeb.LayoutView do
use FrenzyWeb, :view
2019-11-09 18:21:45 +00:00
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
2019-02-11 22:22:35 +00:00
end