mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: add resource_module?/1
back to Ash
This commit is contained in:
parent
ecbdaa1abb
commit
651872a67f
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue