noticed
noticed copied to clipboard
Generators not appearing in "rails -T"
rails -T
does not include the generators included in this gem. I'm using the gem as installed/configured in JSP.
Within JSP:
$ rails -T | grep not
rails annotate_models # Add schema information (as comments) to model and fixture files
rails annotate_routes # Adds the route map to routes.rb
rails db:prepare # Runs setup if database does not exist, or runs migrations if it does
rails remove_annotation # Remove schema information from model and fixture files
~~~
That's interesting, I had noticed that on Madmin the other day that one of the commands wasn't showing. Wonder why that is?
AFAIK you just need that desc
call before the generator method https://edgeguides.rubyonrails.org/generators.html#creating-your-first-generator but its been a while since I did write a generator
I'll try to fix it out of retro curiosity
Closing because I'm an idiot.
-
rails -T
returns list of rake tasks -
rails g
returns list of generators
$ rails g
...
Noticed:
noticed:delivery_method
noticed:model
noticed:notification
- To get help for a generator:
$ rails g noticed:model --help
Usage:
rails generate noticed:model [Notification] [field:type field:type] [options]
...
Ah! That makes sense.
Is it because of the rake file that you see things like rails turbo:install
in rails -T
https://github.com/hotwired/turbo-rails/blob/main/lib/tasks/turbo_tasks.rake
Gonna reopen this. I think it would be handy to have both and we can have the rake task run the generator.
Should be an easy PR if someone wants to do this. 👍
Gonna reopen this. I think it would be handy to have both and we can have the rake task run the generator.
Maybe having one task per generator, or at least repeating the noticed:model
generator, would just add trash to the tasks list.
What we could have is a noticed:install
task that would call noticed:model
and noticed:application_notification
(see #94) generators.
I dunno, we're only going to have 3 generators. I don't think 3 will make anything messy.