Skip to content

Instantly share code, notes, and snippets.

@karlosmid
Created January 24, 2021 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlosmid/c53ae4e0dc453e01fcdd0df651139b2d to your computer and use it in GitHub Desktop.
Save karlosmid/c53ae4e0dc453e01fcdd0df651139b2d to your computer and use it in GitHub Desktop.
How To Securely Use Ecto Preload Function
@timestamps_opts [type: :utc_datetime]
schema "sessions" do
belongs_to(:charter, Charter)
has_many(:note, Note)
has_one(:report, Report)
belongs_to(:author, User)
timestamps()
end
schema "users" do
field(:name, :string)
field(:email, :string)
field(:password, :string, virtual: true)
field(:new_password, :string, virtual: true)
field(:password_hash, :string)
field(:activation_token, :string, size: 256)
field(:activation_token_expires_at, :utc_datetime)
field(:activation_token_activated_at, :utc_datetime)
field(:password_reset_token, :string, size: 256)
field(:password_reset_token_expires_at, :utc_datetime)
field(:current_sign_in_at, :utc_datetime)
field(:last_sign_in_at, :utc_datetime)
field(:current_sign_in_ip, :string)
field(:last_sign_in_ip, :string)
has_many(:session, Session, foreign_key: :author_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment