       Repo.get(Idea, id)
       |> Idea.changeset(%{body: body})
       |> Repo.update!
-      |> Repo.preload(:user)
 
     broadcast! socket, "idea_edited", idea
     {:noreply, socket}

      }
      |> Idea.changeset
      |> Repo.insert!
      |> Repo.preload(:user)

    broadcast! socket, "new_idea_received", idea
    {:noreply, socket}


  def join("retro:" <> retro_id, _, socket) do
    socket = assign(socket, :retro_id, retro_id)
    retro = Repo.get!(Retro, retro_id) |> Repo.preload([:ideas, :votes])

    send self(), :after_join
    {:ok, retro, socket}
