dungnguyen8134
dungnguyen8134
AEAsh Elixir
Created by dungnguyen8134 on 3/15/2023 in #support
Does ash support multi tenancy with foreign key?
I search whole document but there is no place that mention multi tenancy with foreign key. Something like this in Ecto: https://hexdocs.pm/ecto/multi-tenancy-with-foreign-keys.html
6 replies
AEAsh Elixir
Created by dungnguyen8134 on 3/8/2023 in #support
code_interface not expose function
Hi guys, I have a resource like this:
defmodule OrangeCms.Content.ContentType do
use Ash.Resource,
data_layer: AshPostgres.DataLayer

...
code_interface do
define_for(OrangeCms.Content)

define(:open, action: :create, args: [:subject])
end
...
end
defmodule OrangeCms.Content.ContentType do
use Ash.Resource,
data_layer: AshPostgres.DataLayer

...
code_interface do
define_for(OrangeCms.Content)

define(:open, action: :create, args: [:subject])
end
...
end
But when I tried calling open, I got this error
iex(1)> OrangeCms.Content.open(%{subject: "hello"})
** (UndefinedFunctionError) function OrangeCms.Content.open/1 is undefined or private
(orange_cms 0.1.0) OrangeCms.Content.open(%{subject: "hello"})
iex(1)> OrangeCms.Content.open(%{subject: "hello"})
** (UndefinedFunctionError) function OrangeCms.Content.open/1 is undefined or private
(orange_cms 0.1.0) OrangeCms.Content.open(%{subject: "hello"})
Did I do anything wrong with the code?
6 replies