development.rb 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. $stdout.sync = true
  2. Rails.application.configure do
  3. config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload
  4. # Settings specified here will take precedence over those in config/application.rb
  5. # In the development environment your application's code is reloaded on
  6. # every request. This slows down response time but is perfect for development
  7. # since you don't have to restart the web server when you make code changes.
  8. config.cache_classes = false
  9. # Do not eager load code on boot.
  10. config.eager_load = false
  11. # Show full error reports.
  12. config.consider_all_requests_local = true
  13. # Enable/disable caching. By default caching is disabled.
  14. # Run rails dev:cache to toggle caching.
  15. if Rails.root.join('tmp', 'caching-dev.txt').exist?
  16. config.action_controller.perform_caching = true
  17. config.action_controller.enable_fragment_cache_logging = true
  18. config.cache_store = :memory_store
  19. config.public_file_server.headers = {
  20. 'Cache-Control' => "public, max-age=#{2.days.to_i}"
  21. }
  22. else
  23. config.action_controller.perform_caching = false
  24. config.cache_store = :null_store
  25. end
  26. # Print deprecation notices to the Rails logger
  27. config.active_support.deprecation = :log
  28. # Only use best-standards-support built into browsers
  29. config.action_dispatch.best_standards_support = :builtin
  30. # Raise exception for unpermitted parameters
  31. config.action_controller.action_on_unpermitted_parameters = :raise
  32. # Raise an error on page load if there are pending migrations.
  33. config.active_record.migration_error = :page_load
  34. # Highlight code that triggered database queries in logs.
  35. config.active_record.verbose_query_logs = true
  36. # Expands the lines which load the assets
  37. config.assets.debug = true
  38. # Suppress logger output for asset requests.
  39. config.assets.quiet = true
  40. config.action_mailer.default_url_options = { :host => ENV['DOMAIN'] }
  41. config.action_mailer.asset_host = ENV['DOMAIN']
  42. config.action_mailer.raise_delivery_errors = true
  43. if ENV['SEND_EMAIL_IN_DEVELOPMENT'] == 'true'
  44. config.action_mailer.delivery_method = :smtp
  45. else
  46. config.action_mailer.delivery_method = :letter_opener_web
  47. end
  48. config.action_mailer.perform_caching = false
  49. # smtp_settings moved to config/initializers/action_mailer.rb
  50. # Use an evented file watcher to asynchronously detect changes in source code,
  51. # routes, locales, etc. This feature depends on the listen gem.
  52. config.file_watcher = ActiveSupport::EventedFileUpdateChecker
  53. end