File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 66
66
# # Rails configuration tip
67
67
68
68
If you are using Rails 6.1 or newer, add the following `config.generators.after_generate` setting to
69
- your config/application .rb to apply RuboCop autocorrection to code generated by `bin/rails g`.
69
+ your ` config/environments/development .rb` to apply RuboCop autocorrection to code generated by `bin/rails g`.
70
70
71
71
` ` ` ruby
72
- # config/application.rb
73
- module YourCoolApp
74
- class Application < Rails::Application
75
- config.generators.after_generate do |files|
76
- parsable_files = files.filter { |file| file.end_with?('.rb') }
77
- unless parsable_files.empty?
78
- system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
79
- end
72
+ # config/environments/development.rb
73
+ Rails.application.configure do
74
+ config.generators.after_generate do |files|
75
+ parsable_files = files.filter { |file| file.end_with?('.rb') }
76
+ unless parsable_files.empty?
77
+ system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
80
78
end
81
79
end
82
80
end
You can’t perform that action at this time.
0 commit comments