kioopi

kioopi

When i have a Domain with a Resource, lets say Flora and Plant, i can add to the code interface of the Domain in a fragment by re-opening the resources block.

Like this:

resources do
  resource App.Flora.Plant do
    define :grow
  end
end

But calling Ash.Domain.Info.resources(App.Flora) now returns the resource twice.

[App.Flora.Plant, App.Flora.Plant]

Is there a way to make that work without this change up the output of the inspection tools?

Showing Posts 1 to 8

zachdaniel

zachdaniel

Creator of Ash

We can fix this, but is there a particular reason that you need to reopen the resource section?

kioopi

kioopi OP

I have a directory/namespace that contains as much of the code for a feature as possible. A supervisor, actions, etc, and I want to add the new actions to the domain’s code interface.

If here is a better way than adding the different files from my feature dir in the corresponding files in the “core” app i’d be happy to hear about it.

zachdaniel

zachdaniel

Creator of Ash

I think I might need to see more code samples, I’m not quite following :smiley:

kioopi

kioopi OP

Sorry if i’m not clear enough. Pushed the code to github

Domain: XO/lib/xo/games.ex at main · kioopi/XO · GitHub

Resource: XO/lib/xo/games/game.ex at main · kioopi/XO · GitHub

The directory lib/xo/games/commentator/ contains code to add a LLM backed commentator for the game:

Fragment for Resource: XO/lib/xo/games/commentator/game_fragment.ex at main · kioopi/XO · GitHub

Fragment for Domain: XO/lib/xo/games/commentator/domain_fragment.ex at main · kioopi/XO · GitHub

zachdaniel

zachdaniel

Creator of Ash

Ah, sorry I totally misunderstood the fragment bit. That does seem like a problem. It’s not necessarily a bug but we can fix it by combining any duplicate resource declarations at compile time. Please open an issue!

kioopi

kioopi OP

Will do. Is that an Ash issue or rather for Spark?

zachdaniel

zachdaniel

Creator of Ash

An ash issue.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews