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

rails g avo:all_resources should work only for models that inherit from ApplicationRecord #3518

Open
yshmarov opened this issue Dec 12, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@yshmarov
Copy link
Contributor

yshmarov commented Dec 12, 2024

In my app I have a few "virtual" models:

Currently running rails g avo:all_resources also creates empty resources like app/avo/resources/membership_invitation.rb & others

Expectation: create resources only for database-backed models

@Paul-Bob Paul-Bob moved this to Next up in Issues Dec 12, 2024
@Paul-Bob Paul-Bob added the Bug Something isn't working label Dec 12, 2024
@colinross
Copy link

While I agree it should not pick up modules, I don't see it picking up a defined class that implements ActiveModel::Model as a bug, as this behavior is largely in-line with Ruby's approach to duck typing. What is the semantic difference between a resource and a model? In a traditional Rails app, they can be dealt with essentially interchangeably, correct?

That said, I'm not saying that you shouldn't be able to opt-in to some alternative behavior with some level of configuration, but my gut tells me the convention should be that if it's a resource to rails, it should be a resource to avo.

@yshmarov
Copy link
Contributor Author

@colinross I kinda agree. the "issue" is not worth solving

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: Next up
Development

No branches or pull requests

3 participants