Skip to content

Commit 651aae2

Browse files
committed
update config files
1 parent 0465182 commit 651aae2

File tree

7 files changed

+53
-75
lines changed

7 files changed

+53
-75
lines changed

config/application.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
require_relative 'boot'
1+
require_relative "boot"
22

3-
require 'rails/all'
3+
require "rails/all"
44
require 'csv'
55
require 'nkf'
66
require 'rss'
77
require_relative '../lib/enju_leaf/version'
8-
require_relative '../lib/openurl'
8+
require_relative '../lib/openurl
99
1010
# Require the gems listed in Gemfile, including any gems
1111
# you've limited to :test, :development, or :production.
@@ -16,10 +16,13 @@ class Application < Rails::Application
1616
# Initialize configuration defaults for originally generated Rails version.
1717
config.load_defaults 6.1
1818

19-
# Settings in config/environments/* take precedence over those specified here.
20-
# Application configuration can go into files in config/initializers
21-
# -- all .rb files in that directory are automatically loaded after loading
22-
# the framework and any gems in your application.
19+
# Configuration for the application, engines, and railties goes here.
20+
#
21+
# These settings can be overridden in specific environments using the files
22+
# in config/environments, which are processed later.
23+
#
24+
# config.time_zone = "Central Time (US & Canada)"
25+
# config.eager_load_paths << Rails.root.join("extras")
2326
default_locale = (ENV['ENJU_LEAF_DEFAULT_LOCALE'] || 'en').to_sym
2427
config.i18n.default_locale = default_locale
2528
config.i18n.available_locales = [default_locale, :ja, :en].uniq

config/environments/development.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@
1414
# Show full error reports.
1515
config.consider_all_requests_local = true
1616

17+
# Enable server timing
18+
config.server_timing = true
19+
1720
# Enable/disable caching. By default caching is disabled.
1821
# Run rails dev:cache to toggle caching.
19-
if Rails.root.join('tmp', 'caching-dev.txt').exist?
22+
if Rails.root.join("tmp/caching-dev.txt").exist?
2023
config.action_controller.perform_caching = true
2124
config.action_controller.enable_fragment_cache_logging = true
2225

2326
config.cache_store = :memory_store
2427
config.public_file_server.headers = {
25-
'Cache-Control' => "public, max-age=#{2.days.to_i}"
28+
"Cache-Control" => "public, max-age=#{2.days.to_i}"
2629
}
2730
else
2831
config.action_controller.perform_caching = false
@@ -53,11 +56,6 @@
5356
# Highlight code that triggered database queries in logs.
5457
config.active_record.verbose_query_logs = true
5558

56-
# Debug mode disables concatenation and preprocessing of assets.
57-
# This option may cause significant delays in view rendering with a large
58-
# number of complex assets.
59-
config.assets.debug = true
60-
6159
# Suppress logger output for asset requests.
6260
config.assets.quiet = true
6361

@@ -67,10 +65,6 @@
6765
# Annotate rendered view with file names.
6866
# config.action_view.annotate_rendered_view_with_filenames = true
6967

70-
# Use an evented file watcher to asynchronously detect changes in source code,
71-
# routes, locales, etc. This feature depends on the listen gem.
72-
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
73-
7468
# Uncomment if you wish to allow Action Cable access from any origin.
7569
# config.action_cable.disable_request_forgery_protection = true
7670

config/environments/production.rb

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# Disable serving static files from the `/public` folder by default since
2424
# Apache or NGINX already handles this.
25-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
25+
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
2626

2727
# Compress CSS using a preprocessor.
2828
# config.assets.css_compressor = :sass
@@ -31,19 +31,19 @@
3131
config.assets.compile = false
3232

3333
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
34-
# config.asset_host = 'http://assets.example.com'
34+
# config.asset_host = "http://assets.example.com"
3535

3636
# Specifies the header that your server uses for sending files.
37-
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
38-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
37+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
3939

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

4343
# Mount Action Cable outside main process or domain.
4444
# config.action_cable.mount_path = nil
45-
# config.action_cable.url = 'wss://example.com/cable'
46-
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
45+
# config.action_cable.url = "wss://example.com/cable"
46+
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
4747

4848
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4949
# config.force_ssl = true
@@ -72,21 +72,15 @@
7272
# the I18n.default_locale when a translation cannot be found).
7373
config.i18n.fallbacks = true
7474

75-
# Send deprecation notices to registered listeners.
76-
config.active_support.deprecation = :notify
77-
78-
# Log disallowed deprecations.
79-
config.active_support.disallowed_deprecation = :log
80-
81-
# Tell Active Support which deprecation messages to disallow.
82-
config.active_support.disallowed_deprecation_warnings = []
75+
# Don't log any deprecations.
76+
config.active_support.report_deprecations = false
8377

8478
# Use default logging formatter so that PID and timestamp are not suppressed.
8579
config.log_formatter = ::Logger::Formatter.new
8680

8781
# Use a different logger for distributed setups.
8882
# require "syslog/logger"
89-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
83+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
9084

9185
if ENV["RAILS_LOG_TO_STDOUT"].present?
9286
logger = ActiveSupport::Logger.new(STDOUT)
@@ -97,25 +91,5 @@
9791
# Do not dump schema after migrations.
9892
config.active_record.dump_schema_after_migration = false
9993

100-
# Inserts middleware to perform automatic connection switching.
101-
# The `database_selector` hash is used to pass options to the DatabaseSelector
102-
# middleware. The `delay` is used to determine how long to wait after a write
103-
# to send a subsequent read to the primary.
104-
#
105-
# The `database_resolver` class is used by the middleware to determine which
106-
# database is appropriate to use based on the time delay.
107-
#
108-
# The `database_resolver_context` class is used by the middleware to set
109-
# timestamps for the last write to the primary. The resolver uses the context
110-
# class timestamps to determine how long to wait before reading from the
111-
# replica.
112-
#
113-
# By default Rails will store a last write timestamp in the session. The
114-
# DatabaseSelector middleware is designed as such you can define your own
115-
# strategy for connection switching and pass that into the middleware through
116-
# these configuration options.
117-
# config.active_record.database_selector = { delay: 2.seconds }
118-
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
119-
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
12094
config.action_mailer.delivery_method = ENV['ENJU_LEAF_ACTION_MAILER_DELIVERY_METHOD'].to_sym
12195
end

config/environments/test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
Rails.application.configure do
99
# Settings specified here will take precedence over those in config/application.rb.
1010

11-
config.cache_classes = false
12-
config.action_view.cache_template_loading = true
11+
# Turn false under Spring and add config.action_view.cache_template_loading = true.
12+
config.cache_classes = true
1313

14-
# Do not eager load code on boot. This avoids loading your whole application
15-
# just for the purpose of running a single test. If you are using a tool that
16-
# preloads Rails for running tests, you may have to set it to true.
17-
config.eager_load = false
14+
# Eager loading loads your whole application. When running a single test locally,
15+
# this probably isn't necessary. It's a good idea to do in a continuous integration
16+
# system, or in some way before deploying your code.
17+
config.eager_load = ENV["CI"].present?
1818

1919
# Configure public file server for tests with Cache-Control for performance.
2020
config.public_file_server.enabled = true
2121
config.public_file_server.headers = {
22-
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
22+
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2323
}
2424

2525
# Show full error reports and disable caching.

config/initializers/assets.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Be sure to restart your server when you modify this file.
22

33
# Version of your assets, change this if you want to expire all your assets.
4-
Rails.application.config.assets.version = '1.0'
4+
Rails.application.config.assets.version = "1.0"
55

66
# Add additional assets to the asset load path.
77
# Rails.application.config.assets.paths << Emoji.images_path
8-
# Add Yarn node_modules folder to the asset load path.
98
Rails.application.config.assets.paths << Rails.root.join('node_modules')
109

1110
# Precompile additional assets.

config/initializers/inflections.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# are locale specific, and you may define rules for as many different
55
# locales as you wish. All of these examples are active by default:
66
# ActiveSupport::Inflector.inflections(:en) do |inflect|
7-
# inflect.plural /^(ox)$/i, '\1en'
8-
# inflect.singular /^(ox)en/i, '\1'
9-
# inflect.irregular 'person', 'people'
7+
# inflect.plural /^(ox)$/i, "\\1en"
8+
# inflect.singular /^(ox)en/i, "\\1"
9+
# inflect.irregular "person", "people"
1010
# inflect.uncountable %w( fish sheep )
1111
# end
1212
ActiveSupport::Inflector.inflections do |inflect|
@@ -15,5 +15,5 @@
1515

1616
# These inflection rules are supported but not enabled by default:
1717
# ActiveSupport::Inflector.inflections(:en) do |inflect|
18-
# inflect.acronym 'RESTful'
18+
# inflect.acronym "RESTful"
1919
# end

config/initializers/new_framework_defaults_7_0.rb

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
# and asynchronous queries will then be enabled.
4141
# Rails.application.config.active_support.executor_around_test_case = true
4242

43-
# Define the isolation level of most of Rails internal state.
44-
# If you use a fiber based server or job processor, you should set it to `:fiber`.
45-
# Otherwise the default of `:thread` if preferable.
46-
# Rails.application.config.active_support.isolation_level = :thread
47-
4843
# Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
4944
# Rails.application.config.action_mailer.smtp_timeout = 5
5045

@@ -109,18 +104,18 @@
109104

110105

111106
# Cookie serializer: 2 options
112-
#
107+
#
113108
# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
114109
# is `:marshal`. The default for new apps is `:json`.
115110
#
116111
# Rails.application.config.action_dispatch.cookies_serializer = :json
117112
#
118113
#
119114
# To migrate an existing application to the `:json` serializer, use the `:hybrid` option.
120-
#
115+
#
121116
# Rails transparently deserializes existing (Marshal-serialized) cookies on read and
122117
# re-writes them in the JSON format.
123-
#
118+
#
124119
# It is fine to use `:hybrid` long term; you should do that until you're confident *all* your cookies
125120
# have been converted to JSON. To keep using `:hybrid` long term, move this config to its own
126121
# initializer or to `config/application.rb`.
@@ -131,5 +126,18 @@
131126
# If your cookies can't yet be serialized to JSON, keep using `:marshal` for backward-compatibility.
132127
#
133128
# If you have configured the serializer elsewhere, you can remove this section of the file.
134-
#
129+
#
135130
# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
131+
132+
# Change the return value of `ActionDispatch::Request#content_type` to the Content-Type header without modification.
133+
# Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type = false
134+
135+
# Active Storage `has_many_attached` relationships will default to replacing the current collection instead of appending to it.
136+
# Thus, to support submitting an empty collection, the `file_field` helper will render an hidden field `include_hidden` by default when `multiple_file_field_include_hidden` is set to `true`.
137+
# See https://guides.rubyonrails.org/configuring.html#config-active-storage-multiple-file-field-include-hidden for more information.
138+
# Rails.application.config.active_storage.multiple_file_field_include_hidden = true
139+
140+
# ** Please read carefully, this must be configured in config/application.rb (NOT this file) **
141+
# Disables the deprecated #to_s override in some Ruby core classes
142+
# See https://guides.rubyonrails.org/configuring.html#config-active-support-disable-to-s-conversion for more information.
143+
# config.active_support.disable_to_s_conversion = true

0 commit comments

Comments
 (0)