aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/configuration.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Use Rails::Paths::Path#existent in database_configurationPier-Olivier Thibault2014-05-071-1/+1
| | | | | | | | | | | | | Database configuration was trying to load the first path that config.paths['config/database'] was returning even if the path didn't exist in the filesystem. Because Rails::Paths::Path has the possibility to return more than 1 path (as an array), database_configuration should filter down the paths to the existing one and then load the first one. This would make it possible to move the database.yml file and add the new path to paths['config/database'] and still load the configurations.
* Require yaml explicitlyAdrià Planas2014-03-291-0/+1
|
* Add config.annotations, in order to register new extensions for Rake notes ↵robertomiranda2014-03-161-0/+4
| | | | at config level
* Enhance errors while retrieving database configschneems2014-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now if there is an error retrieving database configuration the intent of the error (what the code was trying to do while you got the error) could be more explicit. Instead of this error: ``` Invalid DATABASE_URL: nil (erb):9:in `rescue in <main>' (erb):6:in `<main>' /Users/schneems/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `eval' /Users/schneems/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `result' /Users/schneems/Documents/projects/rails/railties/lib/rails/application/configuration.rb:98:in `database_configuration' /Users/schneems/Documents/projects/rails/activerecord/lib/active_record/railtie.rb:41:in `block in <class:Railtie>' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `instance_exec' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `block in run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `each' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/application.rb:339:in `block in run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/engine/railties.rb:13:in `each' ``` I propose we issue this error: ``` Cannot load `Rails.application.database_configuration`: Invalid DATABASE_URL: nil (erb):9:in `rescue in <main>' (erb):6:in `<main>' /Users/schneems/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `eval' /Users/schneems/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `result' /Users/schneems/Documents/projects/rails/railties/lib/rails/application/configuration.rb:98:in `database_configuration' /Users/schneems/Documents/projects/rails/activerecord/lib/active_record/railtie.rb:41:in `block in <class:Railtie>' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `instance_exec' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `block in run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `each' /Users/schneems/Documents/projects/rails/railties/lib/rails/railtie.rb:237:in `run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/application.rb:339:in `block in run_tasks_blocks' /Users/schneems/Documents/projects/rails/railties/lib/rails/engine/railties.rb:13:in `each' ```
* Ensure Active Record connection consistencyschneems2014-01-091-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently Active Record can be configured via the environment variable `DATABASE_URL` or by manually injecting a hash of values which is what Rails does, reading in `database.yml` and setting Active Record appropriately. Active Record expects to be able to use `DATABASE_URL` without the use of Rails, and we cannot rip out this functionality without deprecating. This presents a problem though when both config is set, and a `DATABASE_URL` is present. Currently the `DATABASE_URL` should "win" and none of the values in `database.yml` are used. This is somewhat unexpected to me if I were to set values such as `pool` in the `production:` group of `database.yml` they are ignored. There are many ways that active record initiates a connection today: - Stand Alone (without rails) - `rake db:<tasks>` - ActiveRecord.establish_connection - With Rails - `rake db:<tasks>` - `rails <server> | <console>` - `rails dbconsole` We should make all of these behave exactly the same way. The best way to do this is to put all of this logic in one place so it is guaranteed to be used. Here is my prosed matrix of how this behavior should work: ``` No database.yml No DATABASE_URL => Error ``` ``` database.yml present No DATABASE_URL => Use database.yml configuration ``` ``` No database.yml DATABASE_URL present => use DATABASE_URL configuration ``` ``` database.yml present DATABASE_URL present => Merged into `url` sub key. If both specify `url` sub key, the `database.yml` `url` sub key "wins". If other paramaters `adapter` or `database` are specified in YAML, they are discarded as the `url` sub key "wins". ``` ### Implementation Current implementation uses `ActiveRecord::Base.configurations` to resolve and merge all connection information before returning. This is achieved through a utility class: `ActiveRecord::ConnectionHandling::MergeAndResolveDefaultUrlConfig`. To understand the exact behavior of this class, it is best to review the behavior in activerecord/test/cases/connection_adapters/connection_handler_test.rb though it should match the above proposal.
* Rename tokens.yml to secrets.ymlGuillermo Iguaran2013-12-121-1/+1
|
* Load secret_key_base from tokens.yml, fallback to config.secret_key_baseGuillermo Iguaran2013-12-121-0/+1
|
* clean up some warnings on trunk rubyAaron Patterson2013-10-311-1/+1
|
* Removed deprecated threadsafe!Paul Nikitochkin2013-07-031-10/+0
|
* Remove deprecated `config.whiny_nils`Vipul A M2013-07-021-3/+0
|
* `initialize_on_precompile` is not used anymore.Terence Lee2013-06-131-1/+0
|
* Bring config.allow_concurrency backJosé Valim2013-03-031-1/+2
| | | | | Since the Rack::Lock still exists in development, let's provide a way to disable it explicitly.
* Remove hard coded references to Active Record in railtiesJosé Valim2013-03-021-6/+7
|
* Update railties/lib/rails/application/configuration.rbiwiznia2013-02-211-3/+3
| | | Better comment for database_configuration method
* Update railties/lib/rails/application/configuration.rbiwiznia2013-02-211-1/+1
| | | Changed comment that referenced the property #database_configuration_file, now it's paths["config/database"]
* standardize database_configuration to a hashTerence Lee2013-02-211-2/+6
| | | | | | | make connection_url_to_hash a class method This als prevents loading database.yml if it doesn't exist but DATABASE_URL does
* config.assets.enabled is now true by defaultDavid Heinemeier Hansson2013-01-051-2/+2
|
* Move background jobs to the 'jobs' branch until fully baked. Not shipping ↵Jeremy Kemper2012-12-211-4/+1
| | | | with Rails 4.0.
* Adding filter capability to ActionController logsFabrizio Regini2012-12-051-1/+2
|
* Better Error handling when parsing database.yamlGaurish Sharma2012-11-201-0/+4
| | | | | Provides a better error message incase the database.yaml has some errors.
* Rename secret_token_key to secret_key_baseSantiago Pastorino2012-11-031-2/+2
|
* Use derived keys everywhere, http_authentication was missing itSantiago Pastorino2012-11-031-6/+2
|
* Sign cookies using key deriverSantiago Pastorino2012-11-031-2/+8
|
* Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-3/+2
|
* Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-3/+4
| | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
* Only compile non-js/css under app/assets by defaultJoshua Peek2012-10-161-1/+1
|
* Merge branch 'master' into asset-path-helperJoshua Peek2012-10-151-5/+5
|\ | | | | | | | | Conflicts: railties/test/application/configuration_test.rb
| * Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-3/+3
| |
| * Test that a Rails.queue consumer is automatically started in productionJeremy Kemper2012-10-131-1/+1
| |
| * Backpedal from class-oriented config.queue. Set an actual queue instance.Jeremy Kemper2012-10-121-1/+1
| |
* | Remove old asset_path from rails configJoshua Peek2012-10-151-5/+1
|/
* Assets cache shouldn't be shared between different environmentsGuillermo Iguaran2012-09-281-1/+1
|
* Remove highly uncommon `config.assets.manifest` option for moving the ↵Guillermo Iguaran2012-09-191-1/+0
| | | | | | manifest path. This option is now unsupported in sprockets-rails.
* Date.beginning_of_week thread local and beginning_of_week application config ↵gregolsen2012-09-181-1/+2
| | | | option added (default is Monday)
* Move queue classes to ActiveSupportSantiago Pastorino2012-09-141-2/+3
|
* Action Mailer async flag is true by default using a Synchronous implSantiago Pastorino2012-09-111-1/+1
|
* Raise more helpful error message on missing gemPrem Sichanugrist2012-08-241-0/+7
| | | | | | Tell people to install `activerecord-session_store` gem when it's not installed instead ofraising `NameError` on missing `ActionDispatch::Session::ActiveRecordStore`.
* Extract ActiveRecord::SessionStore from RailsPrem Sichanugrist2012-08-241-2/+0
| | | | | This functionality will be available from gem `active_record-session_store` instead.
* Deprecate config.threadsafe!José Valim2012-08-211-4/+3
|
* Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-211-2/+1
| | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* Remove allow_concurrency as a flagJosé Valim2012-08-211-3/+1
| | | | | | | | | | | | | | | | The flag was mainly used to add a Rack::Lock middleware to the stack, but the only scenario the lock is desired is in development. If you are deploying on a not-threaded server, the Rack::Lock does not provide any benefit since you don't have concurrent accesses. On the other hand, if you are on a threaded server, you don't want the lock, since it defeats the purpose of using a threaded server. If there is someone out there, running on a thread server and does want a lock, it can be added to your environment as easy as: `use Rack::Lock`