| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Move check from generated helper to test_help.rb, so that all
applications can benefit
* Rather than just raising when the test schema has pending migrations,
try to load in the schema and only raise if there are pending
migrations afterwards
* Opt out of the check by setting
config.active_record.maintain_test_schema = false
* Deprecate db:test:* tasks. The test helper is now fully responsible
for maintaining the test schema, so we don't need rake tasks for this.
This is also a speed improvement since we're no longer reloading the
test database on every call to "rake test".
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
The flag will be used in multiple places to check for errors during runtime if enabled.
Source: https://github.com/rails/sprockets-rails/pull/100
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add information about 'available_locales' and 'enforce_available_locales'
to the configuring guide.
Closes #13202. [ci skip]
|
| | | |
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|/ /
| |
| |
| | |
[ci skip]
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
name of the schema migrations table can be configured.
consolidated test_schema_migrations_table_name tests
Added changelog entry
edited changelog
removed commented lines
removed reader
ensure the schema migrations table is reset at end of test
added entry to configuration guide
guides typo and changelog order
|
|
|
|
| |
:after_initialize runs after config/initializers, not before
|
|
|
|
| |
See `actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb`
|
|\ |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
| |
This option was removed from master.
[ci skip]
|
| |
|
|\
| |
| | |
document how to deploy to a subdirectory [ci skip]
|
| | |
|
| |
| |
| |
| | |
[ci skip]
|
| | |
|
| | |
|
| |
| |
| |
| | |
the configuration and doesn't appear in the config files anymore.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Same rationale as previous revert.
This reverts commit 887225e69b6cdd27f00cf043c4ac918ca5e18cbf.
|
| |
| |
| |
| |
| |
| |
| | |
It is not in the contract that flags have to be singletons,
the use of regular font indicates that.
This reverts commit 80036f9a5341bd831d125dc684841a8433d92070.
|
| | |
|
| |
| |
| |
| | |
/cc @fxn
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We discussed that the auto explain feature is rarely used.
This PR removes only the automatic explain. You can still display
the explain output for any given relation using `ActiveRecord::Relation#explain`.
As a side-effect this should also fix the connection problem during
asset compilation (#9385). The auto explain initializer in the `ActiveRecord::Railtie`
forced a connection.
|
| |
|
|\
| |
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_view/helpers/form_options_helper.rb
guides/code/getting_started/app/controllers/comments_controller.rb
|
| |
| |
| |
| | |
config.action_controller.raise_on_unpermitted_parameters with documentation for config.action_controller.action_on_unpermitted_params.
|
| | |
|
| |
| |
| |
| |
| | |
Capitalization in the title of the section, enumerates the environments
in the usual order, adds a paragraph, and tries to use less "you"s.
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
Conflicts:
guides/source/getting_started.md
|
| | |
|
| |
| |
| |
| | |
guides
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
Proxy servers add X-Forwarded-For headers, resulting in a list of IPs. We
remove trusted IP values, and then take the last given value, assuming that
it is the most likely to be the correct, unfaked value. See [1] for a very
thorough discussion of why that is the best option we have at the moment.
[1]: http://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/
Fixes #7979
|
| |
|
|
|
|
| |
with Rails 4.0.
|