<commit_before>defmodule Vutuv.SocialMediaAccountController do
  use Vutuv.Web, :controller
  alias Vutuv.SocialMediaAccount

  plug Vutuv.Plug.AuthUser when action in [:new, :create, :edit, :update]

  def index(conn, _params) do
    social_media_accounts = Repo.all(SocialMediaAccount)
    render(conn, "index.html", user: conn.assigns[:user], social_media_accounts: social_media_accounts)
  end

  def new(conn, _params) do
    changeset = SocialMediaAccount.changeset(%SocialMediaAccount{})
    render(conn, "new.html", changeset: changeset)
  end<commit_msg>Displays only social media accounts of the user. See #335<commit_after>defmodule Vutuv.SocialMediaAccountController do
  use Vutuv.Web, :controller
  alias Vutuv.SocialMediaAccount

  plug Vutuv.Plug.AuthUser when action in [:new, :create, :edit, :update]

  def index(conn, _params) do
    user =
      conn.assigns[:user]
      |> Repo.preload(:social_media_accounts)

    render(conn, "index.html", user: conn.assigns[:user], social_media_accounts: user.social_media_accounts)
  end

  def new(conn, _params) do
    changeset = SocialMediaAccount.changeset(%SocialMediaAccount{})
    render(conn, "new.html", changeset: changeset)
  end
{'fraction_non_alphanumeric': 0.1048252911813644, 'fraction_numerical': 0.0024958402662229617, 'mean_word_length': 5.075757575757576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3827949', 'n_tokens_mistral': 406, 'n_tokens_neox': 385, 'n_words': 91}