There seems to be no ordinary way to achieve this, however I found a solution to fix the monkeys:
# config/initializers/generators.rb Rails.application.configure do config.generators do |g|
Here are some explanations: hook for test framework is installed directly inside the ControllerGenerator, so we need to load the class to override the value. I do not want to load this class anyway, except for running generators. config.generators
a block is executed for the console and server, so it is not suitable. There is also a self.generators
block, but it runs until config.generators
, and the generator will not be configured. So I found the Engine#load_generators
method that works for me.
Tested with rails 5.0.1.
source share