Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ash.gen.resource warning can not add to resource list #1595

Open
flip111 opened this issue Nov 12, 2024 · 3 comments
Open

ash.gen.resource warning can not add to resource list #1595

flip111 opened this issue Nov 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@flip111
Copy link

flip111 commented Nov 12, 2024

I'm a total noobie to ash and phoenix. I'm getting a bit stuck on a point where i think the user experience could be a bit better.

I ran mix igniter.new fitness --install ash,ash_sqlite,ash_phoenix --with phx.new --extend sqlite

After that i want to run

mix ash.gen.resource Fitness.Exercise \
  --attribute title:string:required \
  --attribute category:string:required \
  --attribute filename:string:required \
  --attribute upload_date:date \
  --attribute daily_quota:integer \
  --uuid-primary-key id \
  --relationship has_many:repetitions:FitnessAsh.Repetition \
  --default-actions read,create,update,destroy \
  --extend ash_sqlite \
  --timestamps

And i see

Igniter - Warnings:

* Domain Elixir.Fitness was not an `Ash.Domain`, so could not add `Fitness.Exercise` to its resource list.

It's not clear to me whether:

  1. I need to add it to the resource list myself
  2. I am not supposed to generate ash models in the existing domain. (I thought later this domain is phoenix-only)
  3. I need to create a new domain for ash first before continuing here
  4. It was not a good choice to generate a new project with --with phx.new for a new user and this is more for advanced users who know how to integrate ash with phoenix better
@flip111 flip111 added enhancement New feature or request needs review labels Nov 12, 2024
@albinkc
Copy link
Contributor

albinkc commented Nov 18, 2024

@flip111
Copy link
Author

flip111 commented Nov 18, 2024

@albinkc thanks that seems to be the way to go

Is there any opportunity to improve UX here by putting the solution into the Ignitor warning or in another place so that it pops up in the terminal? Like this bit "so could not add Fitness.Exercise to its resource list" doesn't really seem like something you would want to do, does it?

@zachdaniel
Copy link
Contributor

What I think we should actually do here is say "X existed but is not an Ash.Domain, should we add use Ash.Domain to the module?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants