<commit_before>defmodule Eecrit.User do
  use Eecrit.Web, :model

  @postgres_string_max 255

  schema "users" do
    field :display_name, :string
    field :login_name, :string
    field :password, :string, virtual: true
    field :password_hash, :string

    belongs_to :current_organization, Eecrit.Organization
    many_to_many :organizations, Eecrit.Organization, join_through: "users_organizations"

    timestamps
  end

  # By (my) convention, `changeset` creates a minimal changeset that
  # does nothing but filter out unwanted params. No fields are<commit_msg>Add ability_group to the schema<commit_after>defmodule Eecrit.User do
  use Eecrit.Web, :model

  @postgres_string_max 255

  schema "users" do
    field :display_name, :string
    field :login_name, :string
    field :password, :string, virtual: true
    field :password_hash, :string

    # The following is really virtual, I guess, but I don't know the
    # right way to express it. It's currently attached to the User via
    # an independent lookup, (not `preload`) because the "primary key"
    # of AbilityGroupChooser is a {userid, organizationid} pair.
    has_one :ability_group, Eecrit.AbilityGroup
    belongs_to :current_organization, Eecrit.Organization
    many_to_many :organizations, Eecrit.Organization, join_through: "users_organizations"

    timestamps
  end

  # By (my) convention, `changeset` creates a minimal changeset that
  # does nothing but filter out unwanted params. No fields are
{'fraction_non_alphanumeric': 0.07210242587601078, 'fraction_numerical': 0.004043126684636119, 'mean_word_length': 4.2105263157894735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2313424', 'n_tokens_mistral': 463, 'n_tokens_neox': 441, 'n_words': 154}