development.rb 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. require "active_support/core_ext/integer/time"
  2. $stdout.sync = true
  3. Rails.application.configure do
  4. # Settings specified here will take precedence over those in config/application.rb.
  5. config.hosts << ENV['DOMAIN']
  6. # In the development environment your application's code is reloaded any time
  7. # it changes. This slows down response time but is perfect for development
  8. # since you don't have to restart the web server when you make code changes.
  9. config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload
  10. config.cache_classes = false
  11. # Do not eager load code on boot.
  12. config.eager_load = false
  13. # Show full error reports.
  14. config.consider_all_requests_local = true
  15. # Enable/disable caching. By default caching is disabled.
  16. # Run rails dev:cache to toggle caching.
  17. if Rails.root.join('tmp', 'caching-dev.txt').exist?
  18. config.action_controller.perform_caching = true
  19. config.action_controller.enable_fragment_cache_logging = true
  20. config.cache_store = :memory_store
  21. config.public_file_server.headers = {
  22. 'Cache-Control' => "public, max-age=#{2.days.to_i}"
  23. }
  24. else
  25. config.action_controller.perform_caching = false
  26. config.cache_store = :null_store
  27. end
  28. # Store uploaded files on the local file system (see config/storage.yml for options).
  29. # config.active_storage.service = :local
  30. # Don't care if the mailer can't send.
  31. config.action_mailer.raise_delivery_errors = false
  32. config.action_mailer.perform_caching = false
  33. # Print deprecation notices to the Rails logger.
  34. config.active_support.deprecation = :log
  35. # Raise exceptions for disallowed deprecations.
  36. config.active_support.disallowed_deprecation = :raise
  37. # Tell Active Support which deprecation messages to disallow.
  38. config.active_support.disallowed_deprecation_warnings = []
  39. # Only use best-standards-support built into browsers
  40. config.action_dispatch.best_standards_support = :builtin
  41. # Raise exception for unpermitted parameters
  42. config.action_controller.action_on_unpermitted_parameters = :raise
  43. # Raise an error on page load if there are pending migrations.
  44. config.active_record.migration_error = :page_load
  45. # Highlight code that triggered database queries in logs.
  46. config.active_record.verbose_query_logs = true
  47. # Debug mode disables concatenation and preprocessing of assets.
  48. # This option may cause significant delays in view rendering with a large
  49. # number of complex assets.
  50. config.assets.debug = true
  51. # Suppress logger output for asset requests.
  52. config.assets.quiet = true
  53. config.action_mailer.default_url_options = { :host => ENV['DOMAIN'] }
  54. config.action_mailer.asset_host = ENV['DOMAIN']
  55. config.action_mailer.raise_delivery_errors = true
  56. if ENV['SEND_EMAIL_IN_DEVELOPMENT'] == 'true'
  57. config.action_mailer.delivery_method = :smtp
  58. else
  59. config.action_mailer.delivery_method = :letter_opener_web
  60. end
  61. config.action_mailer.perform_caching = false
  62. # smtp_settings moved to config/initializers/action_mailer.rb
  63. # Use an evented file watcher to asynchronously detect changes in source code,
  64. # routes, locales, etc. This feature depends on the listen gem.
  65. config.file_watcher = ActiveSupport::EventedFileUpdateChecker
  66. end