Answer the question
In order to leave comments, you need to log in
How to call a specific command in rails after every use of a generator?
Hello.
I want even more magic))) I want to automatically add files created by generators in git. I didn’t find this in the documentation (any hook for generators)
You can, of course, change each generator (take the default ones and drag them into the project by adding a git call, but I don’t want to bother myself with synchronizing changes after each update)
Maybe you can decoy - patch some class that is called when rails generate is called?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
The issue was solved with the Rails::Generators.invoke decoy patch
As an option to do without decoy-patching, create your own generators. guides.rubyonrails.org/generators.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question