diff options
Diffstat (limited to 'config/environments')
| -rw-r--r-- | config/environments/development.rb | 49 | ||||
| -rw-r--r-- | config/environments/production.rb | 52 | ||||
| -rw-r--r-- | config/environments/test.rb | 68 |
3 files changed, 109 insertions, 60 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index 85c9a60..56174f8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb | |||
| @@ -1,17 +1,40 @@ | |||
| 1 | # Settings specified here will take precedence over those in config/environment.rb | 1 | require "active_support/core_ext/integer/time" |
| 2 | 2 | ||
| 3 | # In the development environment your application's code is reloaded on | 3 | Rails.application.configure do |
| 4 | # every request. This slows down response time but is perfect for development | 4 | config.enable_reloading = true |
| 5 | # since you don't have to restart the webserver when you make code changes. | 5 | config.eager_load = false |
| 6 | config.cache_classes = false | ||
| 7 | 6 | ||
| 8 | # Log error messages when you accidentally call methods on nil. | 7 | config.consider_all_requests_local = true |
| 9 | config.whiny_nils = true | 8 | config.server_timing = true |
| 10 | 9 | ||
| 11 | # Show full error reports and disable caching | 10 | if Rails.root.join("tmp/caching-dev.txt").exist? |
| 12 | config.action_controller.consider_all_requests_local = true | 11 | config.action_controller.perform_caching = true |
| 13 | config.action_view.debug_rjs = true | 12 | config.action_controller.enable_fragment_cache_logging = true |
| 14 | config.action_controller.perform_caching = false | 13 | config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } |
| 14 | else | ||
| 15 | config.action_controller.perform_caching = false | ||
| 16 | end | ||
| 15 | 17 | ||
| 16 | # Don't care if the mailer can't send | 18 | config.cache_store = :memory_store |
| 17 | config.action_mailer.raise_delivery_errors = false \ No newline at end of file | 19 | |
| 20 | config.action_mailer.raise_delivery_errors = false | ||
| 21 | config.action_mailer.perform_caching = false | ||
| 22 | config.action_mailer.default_url_options = { host: "localhost", port: 3000 } | ||
| 23 | |||
| 24 | config.active_support.deprecation = :log | ||
| 25 | |||
| 26 | config.active_record.migration_error = :page_load | ||
| 27 | config.active_record.verbose_query_logs = true | ||
| 28 | config.active_record.query_log_tags_enabled = true | ||
| 29 | |||
| 30 | config.active_job.verbose_enqueue_logs = true | ||
| 31 | config.action_dispatch.verbose_redirect_logs = true | ||
| 32 | config.action_view.annotate_rendered_view_with_filenames = true | ||
| 33 | config.action_controller.raise_on_missing_callback_actions = true | ||
| 34 | |||
| 35 | config.hosts.clear | ||
| 36 | config.middleware.delete ExceptionNotification::Rack | ||
| 37 | |||
| 38 | config.assets.debug = false | ||
| 39 | config.assets.digest = true | ||
| 40 | end | ||
diff --git a/config/environments/production.rb b/config/environments/production.rb index 68ceccd..fced949 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb | |||
| @@ -1,35 +1,33 @@ | |||
| 1 | # Settings specified here will take precedence over those in config/environment.rb | 1 | require "active_support/core_ext/integer/time" |
| 2 | 2 | ||
| 3 | # The production environment is meant for finished, "live" apps. | 3 | Rails.application.configure do |
| 4 | # Code is not reloaded between requests | 4 | config.enable_reloading = false |
| 5 | config.cache_classes = true | 5 | config.eager_load = true |
| 6 | config.assume_ssl = true | ||
| 6 | 7 | ||
| 7 | # Full error reports are disabled and caching is turned on | 8 | config.consider_all_requests_local = false |
| 8 | config.action_controller.consider_all_requests_local = false | 9 | config.action_controller.perform_caching = true |
| 9 | config.action_controller.perform_caching = true | ||
| 10 | 10 | ||
| 11 | # See everything in the log (default is :info) | 11 | config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } |
| 12 | # config.log_level = :debug | ||
| 13 | 12 | ||
| 14 | # Use a different logger for distributed setups | 13 | config.log_tags = [ :request_id ] |
| 15 | # config.logger = SyslogLogger.new | 14 | config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) |
| 15 | config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") | ||
| 16 | 16 | ||
| 17 | # Use a different cache store in production | 17 | config.active_support.report_deprecations = false |
| 18 | # config.cache_store = :mem_cache_store | ||
| 19 | 18 | ||
| 20 | # Enable serving of images, stylesheets, and javascripts from an asset server | 19 | config.action_mailer.delivery_method = :sendmail |
| 21 | # config.action_controller.asset_host = "http://assets.example.com" | 20 | config.action_mailer.sendmail_settings = { |
| 21 | location: '/usr/sbin/sendmail', | ||
| 22 | arguments: '-i -t' | ||
| 23 | } | ||
| 24 | config.action_mailer.perform_deliveries = true | ||
| 25 | config.action_mailer.raise_delivery_errors = true | ||
| 26 | config.action_mailer.default_url_options = { host: "ccc.de" } | ||
| 22 | 27 | ||
| 23 | # Disable delivery errors, bad email addresses will be ignored | 28 | config.i18n.fallbacks = true |
| 24 | # config.action_mailer.raise_delivery_errors = false | ||
| 25 | 29 | ||
| 26 | # Enable threaded mode | 30 | config.assets.css_compressor = nil |
| 27 | # config.threadsafe! | 31 | config.active_record.dump_schema_after_migration = false |
| 28 | 32 | config.active_record.attributes_for_inspect = [ :id ] | |
| 29 | ActionMailer::Base.delivery_method = :sendmail | 33 | end |
| 30 | ActionMailer::Base.sendmail_settings = { | ||
| 31 | :location => '/usr/sbin/sendmail', | ||
| 32 | :arguments => '-i -t' | ||
| 33 | } | ||
| 34 | ActionMailer::Base.perform_deliveries = true | ||
| 35 | ActionMailer::Base.raise_delivery_errors = true \ No newline at end of file | ||
diff --git a/config/environments/test.rb b/config/environments/test.rb index 496eb95..bb89065 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb | |||
| @@ -1,27 +1,55 @@ | |||
| 1 | # Settings specified here will take precedence over those in config/environment.rb | ||
| 2 | |||
| 3 | # The test environment is used exclusively to run your application's | 1 | # The test environment is used exclusively to run your application's |
| 4 | # test suite. You never need to work with it otherwise. Remember that | 2 | # test suite. You never need to work with it otherwise. Remember that |
| 5 | # your test database is "scratch space" for the test suite and is wiped | 3 | # your test database is "scratch space" for the test suite and is wiped |
| 6 | # and recreated between test runs. Don't rely on the data there! | 4 | # and recreated between test runs. Don't rely on the data there! |
| 7 | config.cache_classes = true | 5 | |
| 6 | Rails.application.configure do | ||
| 7 | # Settings specified here will take precedence over those in config/application.rb. | ||
| 8 | |||
| 9 | # While tests run files are not watched, reloading is not necessary. | ||
| 10 | config.enable_reloading = false | ||
| 11 | |||
| 12 | # Eager loading loads your entire application. When running a single test locally, | ||
| 13 | # this is usually not necessary, and can slow down your test suite. However, it's | ||
| 14 | # recommended that you enable it in continuous integration systems to ensure eager | ||
| 15 | # loading is working properly before deploying your code. | ||
| 16 | config.eager_load = ENV["CI"].present? | ||
| 17 | |||
| 18 | # Configure public file server for tests with cache-control for performance. | ||
| 19 | config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } | ||
| 20 | |||
| 21 | # Show full error reports. | ||
| 22 | config.consider_all_requests_local = true | ||
| 23 | config.cache_store = :null_store | ||
| 24 | |||
| 25 | # Render exception templates for rescuable exceptions and raise for other exceptions. | ||
| 26 | config.action_dispatch.show_exceptions = :rescuable | ||
| 27 | |||
| 28 | # Disable request forgery protection in test environment. | ||
| 29 | config.action_controller.allow_forgery_protection = false | ||
| 30 | |||
| 31 | # Store uploaded files on the local file system in a temporary directory. | ||
| 32 | config.active_storage.service = :test | ||
| 33 | |||
| 34 | # Tell Action Mailer not to deliver emails to the real world. | ||
| 35 | # The :test delivery method accumulates sent emails in the | ||
| 36 | # ActionMailer::Base.deliveries array. | ||
| 37 | config.action_mailer.delivery_method = :test | ||
| 38 | |||
| 39 | # Set host to be used by links generated in mailer templates. | ||
| 40 | config.action_mailer.default_url_options = { host: "example.com" } | ||
| 8 | 41 | ||
| 9 | # Log error messages when you accidentally call methods on nil. | 42 | # Print deprecation notices to the stderr. |
| 10 | config.whiny_nils = true | 43 | config.active_support.deprecation = :stderr |
| 11 | 44 | ||
| 12 | # Show full error reports and disable caching | 45 | # Raises error for missing translations. |
| 13 | config.action_controller.consider_all_requests_local = true | 46 | # config.i18n.raise_on_missing_translations = true |
| 14 | config.action_controller.perform_caching = false | ||
| 15 | 47 | ||
| 16 | # Disable request forgery protection in test environment | 48 | # Annotate rendered view with file names. |
| 17 | config.action_controller.allow_forgery_protection = false | 49 | # config.action_view.annotate_rendered_view_with_filenames = true |
| 18 | 50 | ||
| 19 | # Tell Action Mailer not to deliver emails to the real world. | 51 | # Raise error when a before_action's only/except options reference missing actions. |
| 20 | # The :test delivery method accumulates sent emails in the | 52 | config.action_controller.raise_on_missing_callback_actions = true |
| 21 | # ActionMailer::Base.deliveries array. | ||
| 22 | config.action_mailer.delivery_method = :test | ||
| 23 | 53 | ||
| 24 | # Use SQL instead of Active Record's schema dumper when creating the test database. | 54 | config.assets.raise_runtime_errors = false |
| 25 | # This is necessary if your schema can't be completely dumped by the schema dumper, | 55 | end |
| 26 | # like if you have constraints or database-specific column types | ||
| 27 | # config.active_record.schema_format = :sql \ No newline at end of file | ||
