<commit_before>defmodule Classlab.User do
  @moduledoc """
  User model. A user can't access events directly but only by membership.
  The membership determines the role: owner, trainer, attendee.
  """
  alias Ecto.{UUID, Query}
  alias Calendar.DateTime
  use Classlab.Web, :model

  # Composable Queries
  def with_valid_access_token(query) do
    from u in query,
      where: u.access_token_expired_at >= ^DateTime.now_utc
  end

  # Fields
  schema "users" do
    field :first_name, :string
    field :last_name, :string
    field :email, :string
    field :access_token, :string
    field :access_token_expired_at, Calecto.DateTimeUTC<commit_msg>remove unused alias in user model<commit_after>defmodule Classlab.User do
  @moduledoc """
  User model. A user can't access events directly but only by membership.
  The membership determines the role: owner, trainer, attendee.
  """
  alias Ecto.UUID
  alias Calendar.DateTime
  use Classlab.Web, :model

  # Composable Queries
  def with_valid_access_token(query) do
    from u in query,
      where: u.access_token_expired_at >= ^DateTime.now_utc
  end

  # Fields
  schema "users" do
    field :first_name, :string
    field :last_name, :string
    field :email, :string
    field :access_token, :string
    field :access_token_expired_at, Calecto.DateTimeUTC
{'fraction_non_alphanumeric': 0.07972665148063782, 'fraction_numerical': 0.0, 'mean_word_length': 3.827838827838828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1733036', 'n_tokens_mistral': 428, 'n_tokens_neox': 415, 'n_words': 131}