aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/configuration_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* applies new string literal convention in railties/testXavier Noria2016-08-061-200/+200
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #25438 from prathamesh-sonpatki/rm-session-store-initializerRafael Mendonça França2016-07-201-0/+16
|\ | | | | | | Setup default session store internally, no longer through an initializer
| * Setup default session store internally, no longer through an application ↵Prathamesh Sonpatki2016-07-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | remove unnecessary sendyuuji.yaginuma2016-07-101-5/+5
|/ | | | | `class_variable_get` is public from Ruby 1.9. Ref: http://ruby-doc.org/core-2.2.0/Module.html#method-i-class_variable_get
* Merge pull request #25652 from prathamesh-sonpatki/rm-boot-railsGuillermo Iguaran2016-07-081-2/+1
|\ | | | | Remove unused boot_rails method and it's usage
| * Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-041-2/+1
| | | | | | | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* | Fix typo in test caseAbhishek Jain2016-07-081-1/+1
|/
* Added a shared section to config/secrets.yml that will be loaded for all ↵David Heinemeier Hansson2016-05-211-0/+25
| | | | environments
* Fix some typos in comments.Joe Rafaniello2016-05-041-1/+1
| | | | [ci skip]
* Fix test nameVipul A M2016-04-231-1/+1
|
* Fixed couple of semantics in the configuration_test.rbAkshay2016-02-281-2/+2
|
* Show permitted flag in the output of AC::Parameters#inspectPrathamesh Sonpatki2016-02-241-1/+1
| | | | - Fixes #23822.
* Alternative to #23638 log to STDOUT via env varschneems2016-02-171-0/+11
| | | | | | People who deploy to containers or other places where they might have some sort of a log wrapping service use stdout. With this change new rails apps can be configured to output to STDOUT via setting `RAILS_LOG_TO_STDOUT` to any value. This allows container images or services to set the value for all apps without having to modify configuration for each application. If an app wants to opt out, they can either delete from the env hash, or remove that configuration. cc/ @rafaelfranca
* Implement ActionController::Parameters#inspectBenjamin Quorning2016-02-171-1/+1
| | | | Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.
* Correct config option from only_api to api_only in testAkshay2016-02-121-1/+1
|
* Default new apps to tag logs with `request_id`schneems2016-01-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In high volume applications it can be very difficult to figure out what is happening in logs because each request is not easily identified. For example 3 requests could look something like this: ``` Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 Rendered welcome/index.html.erb within layouts/application (0.1ms) Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000 Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000 Rendered welcome/index.html.erb within layouts/application (0.1ms) Processing by WelcomeController#index as HTML Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) Processing by WelcomeController#index as HTML Rendered welcome/index.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) Processing by WelcomeController#index as HTML Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` The `:request_id` log tag ensures that each request is tagged with a unique identifier. While they are still interleaved it is possible to figure out which lines belong to which requests. Like: ``` [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 [c6034478-4026-4ded-9e3c-088c76d056f1] Rendered welcome/index.html.erb within layouts/application (0.1ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000 [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000 [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Rendered welcome/index.html.erb within layouts/application (0.1ms) [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Processing by WelcomeController#index as HTML [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Rendered welcome/index.html.erb within layouts/application (0.1ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Processing by WelcomeController#index as HTML [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` Now if you have the logs and you find this unique ID you can filter to only look at information from that request. So a filtered log output would be very clear: ``` [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 [c6034478-4026-4ded-9e3c-088c76d056f1] Rendered welcome/index.html.erb within layouts/application (0.1ms) [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` In addition to this benefit the `:request_id` can be set via the `X-Request-ID` header so that the same request could be traced between multiple components. For example a request comes in Nginx (or another load balancer) could assign a request id. As the load balancer processes the request I can log using that id, then when the request is passed on to Rails, the same id is used. That way if a problem is determined to be not caused in Rails it could be traced back to other components with the same ID. You can set a value in nginx for example using something like this: ``` location / { proxy_pass http://upstream; proxy_set_header X-Request-Id $pid-$msec-$remote_addr-$request_length; } # http://stackoverflow.com/questions/17748735/setting-a-trace-id-in-nginx-load-balancer ``` Heroku sets this header value so problems like timeouts that are logged by like router can be traced back to specific request within the application. Whether you are using components that are setting request ID or not, all production applications can benefit from the additional debugging information of having a unique identifier for all requests. This change will only affect new applications, anyone can opt out by commenting or removing the line in `config/production.rb`.
* add option for per-form CSRF tokensBen Toews2016-01-041-1/+1
|
* ApplicationMailer should be generated by default just like every other ↵David Heinemeier Hansson2015-12-171-0/+1
| | | | Application* parent
* Merge branch 'master' into merge-action-cableRafael Mendonça França2015-12-161-0/+1
|\
| * Introduce ApplicationRecord, an Active Record layer supertypeGenadi Samokovarov2015-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's pretty common for folks to monkey patch `ActiveRecord::Base` to work around an issue or introduce extra functionality. Instead of shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can hold all those custom work the apps may need. Now, we don't wanna encourage all of the application models to inherit from `ActiveRecord::Base`, but we can encourage all the models that do, to inherit from `ApplicationRecord`. Newly generated applications have `app/models/application_record.rb` present by default. The model generators are smart enough to recognize that newly generated models have to inherit from `ApplicationRecord`, but only if it's present.
* | Accept a Pathname in Application#config_forRafael Mendonça França2015-12-151-0/+15
|/ | | | That would make possible to use it with action cable configuration.
* Internal test migrations use the private 'Current' versionMatthew Draper2015-12-151-1/+1
| | | | | | | | Apart from specific versioning support, our tests should focus on the behaviour of whatever version they're accompanying, regardless of when they were written. Application code should *not* do this.
* Make debug_exception_response_format config depends on api_only when is not setJorge Bejar2015-12-091-0/+25
|
* Add tests for api_only configuration settingJorge Bejar2015-12-091-0/+15
|
* Add enabled flag to the public file server.Kasper Timm Hansen2015-11-031-6/+16
| | | | | | | | 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.
* rails/application: allow passing an env to config_forSimon Eskildsen2015-10-301-0/+16
|
* raise `ArgumentError` when `SECRET_KEY_BASE` is an integerArun Agrawal2015-10-271-0/+13
| | | | | | | If `SECRET_KEY_BASE` or other `secret` gets passed as other then string we need to raise `ArgumentError` to know that it's a wrong argument. Closes #22072
* Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-131-0/+10
|\ | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | Eliminate overlapping `app/assets` load pathJeremy Daer2015-09-291-104/+128
| | | | | | | | | | | | | | | | | | | | * Move `app/assets/manifest.js` to `app/assets/config/manifest.js`. Avoid the suggestion that you can/should deep-link `stylesheets/foo`. * Pull in all toplevel stylesheets and JavaScripts, not just `application.js` and `.css`. Demonstrate how to use `link_directory` with a specified `.js`/`.css` type. * Fix RAILS_ENV handling in assets tests. * Shush warnings spam from third-party libs that distract from tests.
* | Fix typo in configuration test descritive > descriptive [ci skip]amitkumarsuroliya2015-09-261-1/+1
|/
* Merge pull request #18587 from ↵Rafael Mendonça França2015-06-031-0/+13
|\ | | | | | | | | | | chrismcg/allow_deliver_later_queue_name_to_be_configured Allow configuration of ActionMailer queue name
| * Allow configuration of ActionMailer queue nameChris McGrath2015-06-021-0/+13
| |
* | Document inline image mailer preview interceptorAndrew White2015-05-041-2/+15
| | | | | | | | Explain what the interceptor is used for and how to remove it.
* | Fix railties configuration testAndrew White2015-05-041-2/+2
|/
* Remove deprecated `serve_static_assets` configurationRafael Mendonça França2015-01-041-16/+0
|
* Remove deprecation warning when log_level is not explicit set on productionRafael Mendonça França2015-01-041-30/+0
|
* Remove some warningsRafael Mendonça França2015-01-031-32/+32
|
* Merge pull request #18100 from chancancode/serve_static_filesGodfrey Chan2014-12-191-1/+57
| | | | | | Allow static asset serving from env variable (enhanced!) Conflicts: railties/CHANGELOG.md
* Fix "nonexistent" typo in testsMelissa Xie2014-12-021-1/+1
|
* Bugfix config.action_view.default_form_builder optionBogdan Gusiev2014-12-011-0/+39
|
* Added tests for log_level deprecationGodfrey Chan2014-11-251-13/+18
| | | | | | Closes #17756 [Godfrey Chan, Zachary Scott]
* Set the test_order in the basic app as well, see 58e8b48Godfrey Chan2014-11-251-0/+25
| | | | This removes the unwanted deprecation warnings in the tests
* :scissors:Rafael Mendonça França2014-11-101-1/+1
|
* No need to sync config.secret_token and secrets.secret_tokenRafael Mendonça França2014-11-101-34/+2
| | | | Just prefer secrets over config
* Merge pull request #16535 from bf4/patch-1Rafael Mendonça França2014-11-101-0/+137
|\ | | | | | | Allow fallback to LegacyKeyGenerator when secret_key_base is not set but secrets.secret_token is
| * `secret_token` is now saved in `Rails.application.secrets.secret_token`Benjamin Fleischer2014-11-021-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `secrets.secret_token` is now used in all places `config.secret_token` was - `secrets.secret_token`, when not present in `config/secrets.yml`, now falls back to the value of `config.secret_token` - when `secrets.secret_token` is set, it over-writes `config.secret_token` so they are the same (for backwards-compatibility) - Update docs to reference app.secrets in all places - Remove references to `config.secret_token`, `config.secret_key_base` - Warn that missing secret_key_base is deprecated - Add tests for secret_token, key_generator, and message_verifier - the legacy key generator is used with the message verifier when secrets.secret_key_base is blank and secret_token is set - app.key_generator raises when neither secrets.secret_key_base nor secret_token are set - app.env_config raises when neither secrets.secret_key_base nor secret_token are set - Add changelog Run focused tests via ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
* | add lib to $LOAD_PATH on application inhertence. fixes #17106Aaron Patterson2014-11-041-1/+2
| |
* | add a test for #17106Aaron Patterson2014-11-041-0/+13
|/
* Fix another false assertionsYuki Nishijima2014-09-211-1/+1
| | | | | | | | | | | | * The assertions in AS::Duration don't actually assert. * The assertion in Railtie will pass even when `eager_load_namespaces` doesn't include `AppTemplate::Application` if `Rails.application` is truthy. For more details, see here: * https://github.com/rails/rails/pull/16998 * https://github.com/rails/rails/pull/17000