| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
You can't compile a file that references a non-compiled asset's path.
.. unless you turn off asset runtime errors.
Outside of a test case like this, `config.assets.precompile` would
normally retain its default entry, which precompiles all images (and
other non-JS/CSS files) that are in `app/assets`.
|
| |
| |
| |
| |
| |
| |
| | |
Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.
Fixes #14748
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes #14620
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll
change to the absolute-path interpretation in 4.2.
The current "correct" spellings for in-memory, relative, and absolute
URLs, respectively, are:
sqlite3::memory:
sqlite3:relative/path
sqlite3:/full/path
Substantially reverses/defers fbb79b517f3127ba620fedd01849f9628b78d6ce.
Uncovered by @guilleiguaran while investigating #14495, though that
sounds like a different issue.
|
| |
| |
| |
| | |
This is a test case for the fix provided in eafec4694c5b37eff9d83b1188b8e331fa6027fa
|
| |
| |
| |
| |
| | |
Just pass in the expected database as argument rather than "caching"
it in a hash and using the hash in the helper methods.
|
| |
| |
| |
| | |
Also fix indent of test block.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Refactor to a reusable method.
|
| |
| |
| |
| |
| | |
No need to check that each line contains an extra space, just matching
the space in the regexp is enough to ensure that.
|
| | |
|
|\ \
| | |
| | | |
Add Public Api for Register New Extensions for Rake Notes
|
| | |
| | |
| | |
| | | |
config/application.rb file
|
| | |
| | |
| | |
| | | |
at config level
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
have an API for register it in the corresponding gems
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.
The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.
Fixes #12133.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.
Conflicts:
railties/CHANGELOG.md
We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.
Fixes #14114.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Squashed commit of the following:
commit 96991e8e919edfb20cc4120bca4e36ed51175d57
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:29:24 2014 -0800
Revert "gems can be added or skipped from the template"
This reverts commit 8beb42cfbc41753ae4dbb91e16abcd1fb7d00356.
Conflicts:
railties/lib/rails/generators/rails/app/app_generator.rb
railties/test/generators/app_generator_test.rb
commit 35599c0e657245ef14ac0f28c9189ad16acf40e6
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:26:53 2014 -0800
Revert "oops, template replay needs to happen after bundle. :orz:"
This reverts commit 9104702be61253f9448ca070a22fc86bb4299555.
Conflicts:
railties/lib/rails/generators/rails/app/app_generator.rb
commit f519c3902c313db8e906a49251c91643b8e6499e
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:25:51 2014 -0800
Revert "only ask for these ivars if the target responds to them"
This reverts commit 656d412546cd97d5660c634c2a41c799d3f9e211.
commit aa524a9428e3e4c45fe221f10a66a08efb827ab5
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:25:39 2014 -0800
Revert "refactor generator tests to use block form of Tempfile"
This reverts commit 65251820ef0ab7f3cffb38130de3dd41af8d72be.
commit 7d3740549fa4dfa62e3761f8d4bc6d6d441256e7
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:25:25 2014 -0800
Revert "add a more restricted codepath for templates fixes #13390"
This reverts commit 2875b4a66e38e4333da887a4afbed33358999298.
commit 525df0af1001918986cdfce59539fd2d52c4f32c
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri Feb 14 11:25:11 2014 -0800
Revert "add a send so `apply` can be called. Fixes #13510"
This reverts commit c5034d60dba0cd31a6a8c612ee35d63b8127793a.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
THIS IS A HUGE HACK. Thor does not allow us to define public methods
without turning them in to "thor tasks". That means we cannot subclass
the `apply` method and make it public, so we have to make the method
private and call `send` on it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add a config on Active Record named `dump_schema_after_migration`
* Schema dump doesn't happen if the config is set to false
* Set default value of the config to true
* Set config in generated production environment file to false
* Update configuration guide
* Update CHANGELOG
|
| |
| |
| |
| |
| |
| |
| |
| | |
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.
This bug was introduced by #11665.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Only config.autoload_paths is frozen, so add the preview_path
to ActiveSupport::Dependencies.autoload_paths directly in an
after_initialize block. Also protect against a blank preview_path
being added to autoload_paths which can cause a serious slowdown
as Dir[] tries to load all *_preview.rb files under /
Fixes #13372
|
| |
| |
| | |
See https://github.com/rails/rails/pull/13463#issuecomment-31480799 for full conversation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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".
|
| | |
|
| |
| |
| |
| | |
By using the URL sub key in the `database.yml` by default we are exposing the ability to set other attributes such as `pool` or `reap_frequency` without need of modifying the URL to contain non-connection specific information.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Right now `db:drop` depends on `load_config` since so when `db:drop` gets executed `load_config` gets run. `db:structure:load` depends on `[:environment, :load_config]`. So before it runs, it executes `environment` but because `load_config` has already executed it is skipped. Note `db:load_config` is "invoke"-d twice, but only "execute"-d once:
```
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:drop
** Invoke db:structure:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config
** Execute db:structure:load
```
The fix for this is making sure that the environment is run before any `load_config`:
```
** Invoke environment (first_time)
** Execute environment
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:drop
** Invoke db:structure:load (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:structure:load
```
|
| |
| |
| |
| |
| |
| |
| |
| | |
Prior to #13463 when `DATABASE_URL` was set, Rails automagically used that value instead of the database.yml. There are tests in dbs_test that expect this to still be true. After that PR, `RAILS_DATABASE_URL` is expected to be read into the YAML file via ERB, this PR fixes that behavior.
Note: this does not entirely fix the tests. It seems that `ActiveRecord::Tasks::DatabaseTasks.current_config` does not process the url string correctly (convert it into a hash), and ` ActiveRecord::Tasks::DatabaseTasks.structure_load(current_config, filename)` as well as other methods in `DatabaseTasks` expect a hash.
It seems like we should involve the resolver somewhere in this process to correctly convert the database url, I do not know the best place for that /cc @josevalim
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We will default this option to true from now on to ensure users properly
handle their list of available locales whenever necessary. This option
was added as a security measure and thus Rails will follow it defaulting
to secure option.
Also improve the handling of I18n config options in its railtie, taking
the new enforce_available_locales option into account, by setting it as
the last one in the process. This ensures no other configuration will
trigger a deprecation warning due to that setting.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|