|
| 1 | +# rubocop:disable Metrics/BlockLength |
| 2 | +# |
| 3 | +def yarn_integrity_enabled? |
| 4 | + ENV.fetch("YARN_INTEGRITY_ENABLED", "true") == "true" |
| 5 | +end |
| 6 | + |
| 7 | +Rails.application.configure do |
| 8 | + # Verifies that versions and hashed value of the package contents in the project's package.json |
| 9 | + config.webpacker.check_yarn_integrity = yarn_integrity_enabled? |
| 10 | + |
| 11 | + # Settings specified here will take precedence over those in config/application.rb. |
| 12 | + |
| 13 | + # In the development environment your application's code is reloaded on |
| 14 | + # every request. This slows down response time but is perfect for development |
| 15 | + # since you don't have to restart the web server when you make code changes. |
| 16 | + config.cache_classes = true |
| 17 | + |
| 18 | + # Do not eager load code on boot. |
| 19 | + config.eager_load = true |
| 20 | + |
| 21 | + # Show full error reports and disable caching. |
| 22 | + config.consider_all_requests_local = true |
| 23 | + |
| 24 | + # Enable/disable caching. By default caching is disabled. |
| 25 | + if Rails.root.join("tmp/caching-dev.txt").exist? |
| 26 | + config.action_controller.perform_caching = true |
| 27 | + |
| 28 | + config.cache_store = :memory_store |
| 29 | + config.public_file_server.headers = { |
| 30 | + "Cache-Control" => "public, max-age=172800" |
| 31 | + } |
| 32 | + else |
| 33 | + config.action_controller.perform_caching = false |
| 34 | + |
| 35 | + config.cache_store = :null_store |
| 36 | + end |
| 37 | + |
| 38 | + config.assets_debug = false |
| 39 | + config.assets_compile = false |
| 40 | + |
| 41 | + config.web_console.development_only = false |
| 42 | + |
| 43 | + # Don't care if the mailer can't send. |
| 44 | + config.action_mailer.raise_delivery_errors = false |
| 45 | + |
| 46 | + # Print deprecation notices to the Rails logger. |
| 47 | + config.active_support.deprecation = :log |
| 48 | + |
| 49 | + # Raise an error on page load if there are pending migrations. |
| 50 | + config.active_record.migration_error = :page_load |
| 51 | + |
| 52 | + # Debug mode disables concatenation and preprocessing of assets. |
| 53 | + # This option may cause significant delays in view rendering with a large |
| 54 | + # number of complex assets. |
| 55 | + config.assets.debug = false |
| 56 | + |
| 57 | + # Asset digests allow you to set far-future HTTP expiration dates on all assets, |
| 58 | + # yet still be able to expire them through the digest params. |
| 59 | + config.assets.digest = false |
| 60 | + |
| 61 | + # Supress logger output for asset requests. |
| 62 | + config.assets.quiet = true |
| 63 | + |
| 64 | + # Adds additional error checking when serving assets at runtime. |
| 65 | + # Checks for improperly declared sprockets dependencies. |
| 66 | + # Raises helpful error messages. |
| 67 | + config.assets.raise_runtime_errors = true |
| 68 | + |
| 69 | + config.action_mailer.perform_caching = false |
| 70 | + |
| 71 | + config.app_domain = "localhost:3000" |
| 72 | + |
| 73 | + config.action_mailer.default_url_options = { host: "localhost:3000" } |
| 74 | + config.action_mailer.delivery_method = :smtp |
| 75 | + config.action_mailer.perform_deliveries = true |
| 76 | + config.action_mailer.default_url_options = { host: config.app_domain } |
| 77 | + config.action_mailer.smtp_settings = { |
| 78 | + address: "smtp.gmail.com", |
| 79 | + port: "587", |
| 80 | + enable_starttls_auto: true, |
| 81 | + user_name: '<%= ENV["DEVELOPMENT_EMAIL_USERNAME"] %>', |
| 82 | + password: '<%= ENV["DEVELOPMENT_EMAIL_PASSWORD"] %>', |
| 83 | + authentication: :plain, |
| 84 | + domain: "localhost:3000" |
| 85 | + } |
| 86 | + |
| 87 | + config.action_mailer.preview_path = "#{Rails.root}/spec/mailers/previews" |
| 88 | + |
| 89 | + # Raises error for missing translations |
| 90 | + # config.action_view.raise_on_missing_translations = true |
| 91 | + |
| 92 | + config.public_file_server.enabled = true |
| 93 | + |
| 94 | + config.file_watcher = ActiveSupport::EventedFileUpdateChecker |
| 95 | + |
| 96 | + # Install the Timber.io logger |
| 97 | + send_logs_to_timber = ENV["SEND_LOGS_TO_TIMBER"] || "false" # <---- set to false to stop sending dev logs to Timber.io |
| 98 | + log_device = send_logs_to_timber == "true" ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT |
| 99 | + logger = Timber::Logger.new(log_device) |
| 100 | + logger.level = config.log_level |
| 101 | + config.logger = ActiveSupport::TaggedLogging.new(logger) |
| 102 | + |
| 103 | + config.after_initialize do |
| 104 | + Bullet.enable = true |
| 105 | + Bullet.console = true |
| 106 | + end |
| 107 | +end |
| 108 | + |
| 109 | +# rubocop:enable Metrics/BlockLength |
0 commit comments