This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAshPhoenixApp.Client.Department do | |
use Ash.Resource, | |
domain: MyAshPhoenixApp.Client, | |
data_layer: AshPostgres.DataLayer | |
multitenancy do | |
strategy :attribute # ----->>>>>> causes warning | |
attribute :id | |
# attribute :domain | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAshPhoenixApp.Client.Organization do | |
use Ash.Resource, | |
domain: MyAshPhoenixApp.Client, | |
data_layer: AshPostgres.DataLayer | |
defimpl Ash.ToTenant do | |
# %{:domain => _, :id => _, _ => _} | |
# def to_tenant(resource, %MyAshPhoenixApp.Client.Organization{id: id}) do ## ----->>>>> this line causes a compilation error | |
def to_tenant(resource, %{:domain => domain, :id => id}) do ## ---->>>> this line creates a warning | |
if Ash.Resource.Info.data_layer(resource) == AshPostgres.DataLayer |