diff --git a/README.md b/README.md index ca42e975a5..4a5892731c 100644 --- a/README.md +++ b/README.md @@ -66,17 +66,15 @@ end ## Rails configuration tip If you are using Rails 6.1 or newer, add the following `config.generators.after_generate` setting to -your config/application.rb to apply RuboCop autocorrection to code generated by `bin/rails g`. +your `config/environments/development.rb` to apply RuboCop autocorrection to code generated by `bin/rails g`. ```ruby -# config/application.rb -module YourCoolApp - class Application < Rails::Application - config.generators.after_generate do |files| - parsable_files = files.filter { |file| file.end_with?('.rb') } - unless parsable_files.empty? - system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true) - end +# config/environments/development.rb +Rails.application.configure do + config.generators.after_generate do |files| + parsable_files = files.filter { |file| file.end_with?('.rb') } + unless parsable_files.empty? + system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true) end end end