method
config_when_updating
v8.1.1 -
Show latest stable
- Class:
Rails::AppBuilder
config_when_updating()public
No documentation available.
# File railties/lib/rails/generators/rails/app/app_generator.rb, line 142
def config_when_updating
action_cable_config_exist = File.exist?("config/cable.yml")
active_storage_config_exist = File.exist?("config/storage.yml")
ci_config_exist = File.exist?("config/ci.rb")
bundle_audit_config_exist = File.exist?("config/bundler-audit.yml")
rack_cors_config_exist = File.exist?("config/initializers/cors.rb")
assets_config_exist = File.exist?("config/initializers/assets.rb")
asset_app_stylesheet_exist = File.exist?("app/assets/stylesheets/application.css")
csp_config_exist = File.exist?("config/initializers/content_security_policy.rb")
@config_target_version = Rails.application.config.loaded_config_version || "5.0"
config
if !skip_action_cable? && !action_cable_config_exist
template "config/cable.yml"
end
if !skip_active_storage? && !active_storage_config_exist
template "config/storage.yml"
end
if !ci_config_exist
template "config/ci.rb"
end
if skip_asset_pipeline? && !assets_config_exist
remove_file "config/initializers/assets.rb"
end
if skip_asset_pipeline? && !asset_app_stylesheet_exist
remove_file "app/assets/stylesheets/application.css"
end
unless rack_cors_config_exist
remove_file "config/initializers/cors.rb"
end
if !skip_bundler_audit? && !bundle_audit_config_exist
template "config/bundler-audit.yml"
end
if options[:api]
unless csp_config_exist
remove_file "config/initializers/content_security_policy.rb"
end
end
end