mirror of
https://github.com/ash-project/ash.git
synced 2024-09-19 13:03:02 +12:00
improvement: Add Changeset.is_valid/1
guard. (#1437)
This commit is contained in:
parent
b6e1e80fc2
commit
295778bbf5
1 changed files with 6 additions and 0 deletions
|
@ -362,6 +362,12 @@ defmodule Ash.Changeset do
|
|||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
A guard which checks if the Changeset is valid.
|
||||
"""
|
||||
@spec is_valid(t) :: Macro.output()
|
||||
defguard is_valid(changeset) when is_struct(changeset, __MODULE__) and changeset.valid? == true
|
||||
|
||||
@doc """
|
||||
Returns a new changeset over a resource.
|
||||
|
||||
|
|
Loading…
Reference in a new issue