<commit_before>defmodule Classlab.Event do
  use Classlab.Web, :model

  schema "events" do
    field :public, :boolean, default: false
    field :slug, :string
    field :name, :string
    field :description, :string
    field :starts_at, Ecto.DateTime
    field :ends_at, Ecto.DateTime
    field :timezone, :string

    timestamps()
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """
  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:public, :slug, :name, :description, :starts_at, :ends_at, :timezone])
    |> validate_required([:public, :slug, :name, :description, :starts_at, :ends_at, :timezone])
  end
end<commit_msg>Add associations for event model<commit_after>defmodule Classlab.Event do
  use Classlab.Web, :model

  schema "events" do
    field :public, :boolean, default: false
    field :slug, :string
    field :name, :string
    field :description, :string
    field :starts_at, Ecto.DateTime
    field :ends_at, Ecto.DateTime
    field :timezone, :string
    timestamps()

    # has_one :location, Classlab.Location
    # has_many :feedbacks, Classlab.Feedback
    # has_many :invitations, Classlab.Invitation
    # has_many :materials, Classlab.Material
    # has_many :memberships, Classlab.Membership
    # has_many :tasks, Classlab.Task
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """
  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:public, :slug, :name, :description, :starts_at, :ends_at, :timezone])
    |> validate_required([:public, :slug, :name, :description, :starts_at, :ends_at, :timezone])
  end
end
{'fraction_non_alphanumeric': 0.1276595744680851, 'fraction_numerical': 0.0, 'mean_word_length': 3.8269794721407626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4185013', 'n_tokens_mistral': 557, 'n_tokens_neox': 550, 'n_words': 153}