aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/configuration.rb
Commit message (Collapse)AuthorAgeFilesLines
* Start Rails 5.2 developmentMatthew Draper2017-03-221-0/+3
|
* Correctly check whether key is defined in configurationyuuji.yaginuma2017-03-191-3/+3
| | | | | | | | | | | | | It can not check correctly with `defined?` ```ruby irb(main):001:0> Rails.application.config.active_record => {:maintain_test_schema=>true, :belongs_to_required_by_default=>true} irb(main):002:0> defined?(Rails.application.config.active_record) => nil ``` Follow up to #28469
* Track the version-compatible config settings inside railtiesMatthew Draper2017-03-181-0/+28
| | | | | | | | | | | | | | | | Instead of forcing new applications to carry an initializer that just switches things to what their default "should" be, we can handle it internally. The initializer is then only used by upgraders: it shows what the new default would be (commented out), while their upgraded application continues to operate as it did before. Under this model, a multiply-upgraded application could accumulate several new_framework_defaults_*.rb files, for each release series it has traversed. A given release series only needs to generate the latest, though, because we don't support `rails app:upgrade` while skipping releases.
* Revert "Revert "Add encrypted secrets""Kasper Timm Hansen2017-02-231-2/+4
|
* Revert "Add encrypted secrets" (#28127)David Heinemeier Hansson2017-02-231-4/+2
|
* Add encrypted secrets (#28038)Kasper Timm Hansen2017-02-231-2/+4
|
* Merge pull request #27652 from y-yagi/remove_unused_requireRafael França2017-01-111-2/+0
|\ | | | | remove unused requires
| * remove unused requiresyuuji.yaginuma2017-01-121-2/+0
| | | | | | | | Related to 0129ca2eeb6d5b2ea8c6e6be38eeb770fe45f1fa, f7782812f7e727178e4a743aa2874c078b722eef, f9ed83321ac1d1902578a0aacdfe55d3db754219
* | Current default Rails app encoding "utf-8" looks more like a W3C charset ↵Akira Matsuda2017-01-111-1/+1
|/ | | | than a ruby encoding
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Remove deprecated config.serve_static_filesRafael Mendonça França2017-01-031-19/+0
|
* Remove deprecated `config.static_cache_control`Rafael Mendonça França2017-01-031-12/+1
|
* applies new string literal convention in railties/libXavier Noria2016-08-061-7/+7
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Suppress warningsyui-knk2016-07-311-0/+1
| | | | | | | This commit suppressed `warning: instance variable @session_store not initialized`. e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57 introduced these warnings.
* Merge pull request #25438 from prathamesh-sonpatki/rm-session-store-initializerRafael Mendonça França2016-07-201-11/+17
|\ | | | | | | Setup default session store internally, no longer through an initializer
| * Setup default session store internally, no longer through an application ↵Prathamesh Sonpatki2016-07-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | initializer - By default the session store will be set to cookie store with application name as session key. - Older apps are not affected as they will have the session store initializer generated by Rails in older versions, and Rails will not overwrite the session store if it is already set or disabled. - But new apps will not have the initializer, instead the session store will be set to cookie store by default. - Based on comment by DHH here - https://github.com/rails/rails/issues/25181#issuecomment-222312764.
| * Refactor the existing session_store to use keyword args and raise early when ↵Prathamesh Sonpatki2016-07-171-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set to activerecord session store - Use keyword args as it is possible to use them now. - The error message for activerecord-session_store gem was added in 1807384. - But it was added for a code path which gets called when we try to **access** the session store, not when we **set** it. - So the test expecting the exception started failing because now the session store is set via railtie again **after** setting it first with :active_record_store in the test. - As the error is not raised while setting the store to :active_record_store, the store gets overwritten by railtie and when we access it via `session_store` while building the default middleware stack, the exception is not raised. - This commit moves the code for raising the exception to the path where we try to set the store.
| * Introduce a new method for checking whether session_store is set by user or ↵Prathamesh Sonpatki2016-07-171-0/+4
|/ | | | | | | | | | | by Rails - We need to ability to check whether the session store it is set or not so that we can set it ourselves in an internal initializer. - We can't rely on return value of `config.session_store` as it can return `nil` when set to `disabled` and we will accidentally override it and set to default cookie store. - So introduced new method which just tells us whether it is set or not.
* implement respond_to_missing? to match method_missingDavid Feldman2016-07-051-0/+4
|
* Initialize the configuration with a valueRafael Mendonça França2016-06-221-1/+2
| | | | | | | This will fix the failures fixed by 41488adbb89a09fa96188486f8414842ff28c848 and keep this new option that is semi-private outside of the generated configurations
* Add `config` to the deprecation warnings of deprecated config optionsPrathamesh Sonpatki2016-04-101-3/+3
|
* Added 'config.' to deprecation warningAlexander Kalinichev2016-03-261-2/+2
| | | | Misc: `config.public_file_server.enabled = true` instead `public_file_server.enabled = true`
* let config.file_watcher be the way to enable the evented file watcherXavier Noria2015-12-131-17/+12
| | | | | | | | | | | Before this commit, the sole presence of the Listen constant enabled the evented file watcher (unless listen resorted to the polling backend). This way, applications may depend on listen for other stuff independently of this feature. Also, allows teams with mixed setups to decide at boot time whether the evented watcher should be enabled for each particular instance.
* Make debug_exception_response_format config depends on api_only when is not setJorge Bejar2015-12-091-2/+12
|
* debug_exception_response_format needs to be writeable in ConfigurationJorge Bejar2015-12-091-2/+2
|
* Add debug_exception_response_format config to configure DebugExceptionJorge Bejar2015-12-091-30/+31
| | | | behavior
* Disable FileEventedUpdateChecker for nowRafael Mendonça França2015-12-041-5/+1
| | | | | Railsties tests are broken with this new update checker so we will use the old one until we have the tests fixed.
* Make the `static_index` config part of the `config.public_server` configYuki Nishijima2015-11-161-2/+2
| | | | Also call it `public_server.index_name` so it'll make more sense.
* encapsulates the logic to choose the file monitor in app configXavier Noria2015-11-101-1/+9
|
* implements an evented file update checker [Puneet Agarwal]Xavier Noria2015-11-081-1/+1
| | | | | | | | | | | | This is the implementation of the file update checker written by Puneet Agarwal for GSoC 2015 (except for the tiny version of the listen gem, which was 3.0.2 in the original patch). Puneet's branch became too out of sync with upstream. This is the final work in one single clean commit. Credit goes in the first line using a convention understood by the contrib app.
* Fix `static_cache_control` deprecation warningJon Atack2015-11-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | 1. Fix the message by wrapping the value in missing quotes and adding the missing backtick at the end. Finally, :lipstick: by adding a space inside the curly braces. Before: `config.public_file_server.headers = {'Cache-Control' => public, max-age=31536000} Now: `config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' }` 2. Display `static_cache_control` instead of static_cache_control. This follows what the 2 neighboring methods are doing. 3. Use strip_heredoc to improve the code formatting and readability like the 2 neighboring methods and wrap to 80 characters.
* Add enabled flag to the public file server.Kasper Timm Hansen2015-11-031-2/+23
| | | | | | | | As discussed in https://github.com/rails/rails/pull/19135#issuecomment-153385986. Replaces `serve_static_files` to unify the static options under the `public_file_server` wing. Deprecates `serve_static_files` accessors, but make them use the newer config internally.
* Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-131-3/+11
|\ | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* | Stop modifying global variableseileencodes2015-09-291-1/+0
|/ | | | | | Allocating a new middleware proxy in each application configuration and then merging the app specific config with the global config when the app is built.
* config.api_only = true implies config.generators.api_only = trueSantiago Pastorino2015-06-111-2/+7
|
* Add config.api_only option to application and remove appropriate middleware ↵Santiago Pastorino2015-06-111-1/+2
| | | | when true
* config.static_index configures directory index "index.html" filenameEliot Sykes2015-05-281-2/+3
| | | | | | Set `config.static_index` to serve a static directory index file not named `index`. For example, to serve `main.html` instead of `index.html` for directory requests, set `config.static_index` to `"main"`.
* Remove config.assetsJoshua Peek2015-01-211-16/+1
| | | | Provided by sprockets-rails plugin
* Remove deprecated `serve_static_assets` configurationRafael Mendonça França2015-01-041-21/+0
|
* Remove deprecation warning when log_level is not explicit set on productionRafael Mendonça França2015-01-041-10/+1
|
* Merge pull request #18100 from chancancode/serve_static_filesGodfrey Chan2014-12-191-2/+23
| | | | | | Allow static asset serving from env variable (enhanced!) Conflicts: railties/CHANGELOG.md
* Deprecate different default for `log_level` in productionGodfrey Chan2014-11-171-2/+11
| | | | | | This is a more conservative approach to 2602a49. Also changed the comment to be more inline with everything else in the file (describing what the config value is doing and why). People should just read the docs for alternatives.
* Revert "Merge pull request #16622 from matthewd/default-debug"Godfrey Chan2014-11-171-1/+1
| | | | | | | | | This reverts commit 2602a49a8600ab52f807599bbd5b1f9c0be4214f, reversing changes made to 5d7c1057684c377bc2801c8851e99ff11ab23530. The explicit default was introduced in 21f6d72, so apps created with Rails < 4 have the commented out version, which means that this change would break those apps.
* Tell the user which file is missing when config/database.yml was not foundAkira Matsuda2014-09-101-3/+4
| | | | | | Since cc03675d30b58e28f585720dad14e947a57ff5b the error message became like "Could not load database configuration. No such file -" which doesn't really tell what's actually missing.
* Don't fight against ourselves for the default log levelMatthew Draper2014-08-221-1/+1
| | | | | | | If we want to always default to :debug, let's just do that. At which point the production.rb entry can become an "uncomment to change" instead.
* Fix setting simple values to the new config.xCarlos Antonio da Silva2014-08-191-4/+10
| | | | | | | | | | Previously setting simple values to the config.x object resulted in the following: config.x.super_debugger = true config.x.super_debugger #=> {} Which was against the examples showed in the changelog/release notes.
* Revert "Improve custom configuration"Rafael Mendonça França2014-08-191-1/+13
| | | | | | | | | This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336. Conflicts: railties/lib/rails/railtie/configuration.rb It added regression. Will be back after the beta
* Improve custom configurationRafael Mendonça França2014-08-191-13/+1
| | | | | | | | | | | | | | | | 1. Hashes can be assigned 2. We don't need a special level anymore The method chain only works in the top level. If users need a second level they need to assign a OrderedOptions to the key: config.resque.server = ActiveSupport::OrderedOptions.new config.resque.server.url = "http://localhost" config.resque.server.port = 3000 [Rafael Mendonça França + Carlos Antonio da Silva]
* Pull in the custom configuration concept from dhh/custom_configurationDavid Heinemeier Hansson2014-08-031-1/+13
|