fix: add resource_module?/1 back to Ash

This commit is contained in:
Zach Daniel 2020-06-04 22:43:51 -04:00
parent ecbdaa1abb
commit 651872a67f
No known key found for this signature in database
GPG key ID: C377365383138D4B

View file

@ -67,6 +67,14 @@ defmodule Ash do
resource.relationships()
end
@spec resource_module?(module) :: boolean
def resource_module?(module) do
:attributes
|> module.module_info()
|> Keyword.get(:behaviour, [])
|> Enum.any?(&(&1 == Ash.Resource))
end
@doc false
def primary_action!(resource, type) do
case primary_action(resource, type) do