Skip to content

Commit

Permalink
doc: add docstring for timestamps helper macro (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidalgol authored Nov 3, 2024
1 parent 203170f commit c40cf84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ash/resource/attribute.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ defmodule Ash.Resource.Attribute do
defmodule Helpers do
@moduledoc "Helpers for building attributes"

@doc """
Defines create and update timestamp attributes.
Shorthand for `d:Ash.Resource.Dsl.attributes.create_timestamp` and
`d:Ash.Resource.Dsl.attributes.update_timestamp` with the attribute names
`:inserted_at` and `:updated_at` respectively. Any options passed to this
helper are passed to both timestamp macros.
"""
defmacro timestamps(opts \\ []) do
quote do
create_timestamp :inserted_at, unquote(opts)
Expand Down

0 comments on commit c40cf84

Please sign in to comment.