Skip to content

Commit

Permalink
update development.rb to rails 8 defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-mcneil committed Dec 17, 2024
1 parent 749b3f4 commit 706642c
Showing 1 changed file with 35 additions and 31 deletions.
66 changes: 35 additions & 31 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,76 +6,80 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

# Specify environment specific hostname and protocol
config.hostname = Settings.hostname
config.hosts = Settings.virtual_hosts
config.protocol = 'http'
routes.default_url_options = { host: config.hostname, protocol: config.protocol }

# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Make code changes take effect immediately without server restart.
config.enable_reloading = true

# Do not eager load code on boot.
config.eager_load = false

# Show full error reports.
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
# Enable server timing.
config.server_timing = true

# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
# Run rails dev:cache to toggle Action Controller caching.
if Rails.root.join('tmp/caching-dev.txt').exist?

Check failure on line 23 in config/environments/development.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Rails/FilePath: Prefer `Rails.root.join('path', 'to')`.
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :redis_cache_store, { url: Settings.redis.rails_cache.url, expires_in: 30.minutes }
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
}
config.public_file_server.headers = { 'cache-control' => "public, max-age=#{2.days.to_i}" }
else
config.action_controller.perform_caching = false

config.cache_store = :null_store
end

# Store files locally. To switch to aws locally use :amazon
# Specify environment specific hostname and protocol
config.hostname = Settings.hostname
config.hosts = Settings.virtual_hosts
config.protocol = 'http'
routes.default_url_options = { host: config.hostname, protocol: config.protocol }

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local

# Don't care if the mailer can't send.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = false

# Make template changes take effect immediately.
config.action_mailer.perform_caching = false

# Set localhost to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: config.hostname, protocol: config.protocol }
config.action_mailer.logger = Logger.new('./log/mailer.log') if File.exist?('./log/mailer.log')

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise

# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []

# Raise an error on page load if there are pending migrations.
# config.active_record.migration_error = :page_load
config.active_record.migration_error = :page_load

# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
# config.assets.debug = true
# Append comments with runtime information tags to SQL queries in logs.
config.active_record.query_log_tags_enabled = true

# Suppress logger output for asset requests.
# config.assets.quiet = true
# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Raises error for missing translations.
config.i18n.raise_on_missing_translations = true

ConfigHelper.setup_action_mailer(config)

# Annotate rendered view with file names.
config.action_view.annotate_rendered_view_with_filenames = true

# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true

# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate! # TODO: Uncomment me?

config.rails_semantic_logger.semantic = false
config.rails_semantic_logger.started = true
config.rails_semantic_logger.processing = true
Expand Down

0 comments on commit 706642c

Please sign in to comment.