From c40cf84ef689722818f3d8147faaf807f33ee629 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 3 Nov 2024 22:32:06 +1300 Subject: [PATCH] doc: add docstring for timestamps helper macro (#1573) --- lib/ash/resource/attribute.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ash/resource/attribute.ex b/lib/ash/resource/attribute.ex index 084b290eb..0569fa63f 100644 --- a/lib/ash/resource/attribute.ex +++ b/lib/ash/resource/attribute.ex @@ -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)