diff options
Diffstat (limited to 'railties/lib/rails/application/configuration.rb')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index dc3ec4274b..ee9c87b5cf 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -11,12 +11,12 @@ module Rails :eager_load, :exceptions_app, :file_watcher, :filter_parameters, :force_ssl, :helpers_paths, :logger, :log_formatter, :log_tags, :railties_order, :relative_url_root, :secret_key_base, :secret_token, - :serve_static_files, :ssl_options, :static_cache_control, :session_options, - :time_zone, :reload_classes_only_on_change, + :serve_static_files, :ssl_options, :static_index, :public_file_server, + :session_options, :time_zone, :reload_classes_only_on_change, :beginning_of_week, :filter_redirect, :x attr_writer :log_level - attr_reader :encoding + attr_reader :encoding, :api_only, :static_cache_control def initialize(*) super @@ -27,7 +27,8 @@ module Rails @filter_redirect = [] @helpers_paths = [] @serve_static_files = true - @static_cache_control = nil + @static_index = "index" + @public_file_server = ActiveSupport::OrderedOptions.new @force_ssl = false @ssl_options = {} @session_store = :cookie_store @@ -35,7 +36,6 @@ module Rails @time_zone = "UTC" @beginning_of_week = :monday @log_level = nil - @middleware = app_middleware @generators = app_generators @cache_store = [ :file_store, "#{root}/tmp/cache/" ] @railties_order = [:all] @@ -48,9 +48,18 @@ module Rails @eager_load = nil @secret_token = nil @secret_key_base = nil + @api_only = false @x = Custom.new end + def static_cache_control=(value) + ActiveSupport::Deprecation.warn("static_cache_control is deprecated and will be removed in Rails 5.1. " \ + "Please use `config.public_file_server.headers = {'Cache-Control' => #{value}} " \ + "instead.") + + @static_cache_control = value + end + def encoding=(value) @encoding = value silence_warnings do @@ -59,6 +68,11 @@ module Rails end end + def api_only=(value) + @api_only = value + generators.api_only = value + end + def paths @paths ||= begin paths = super |