| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
|
|
|
| |
Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Allows custom rake tasks to be defined using:
SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true
|
|
|
|
| |
Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
|
|
|
|
|
|
|
|
| |
* Fix Migration#reversible by not using `transaction`.
* Adapt mysql adapter to updated api for remove_column
* Update test after aedcd683684d08eaf30623a4b48ce31a31426372
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Finished tests in 56.245787s, 0.2133 tests/s, 0.0000 assertions/s.
12 tests, 0 assertions, 0 failures, 0 errors, 0 skips
After:
Finished tests in 42.401416s, 0.2830 tests/s, 0.0000 assertions/s.
12 tests, 0 assertions, 0 failures, 0 errors, 0 skips
|
|
|
|
| |
Related to changes introduced in 553b563749517114323b4e8742509227e0daab67
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
I found them when I was running
warning mode on with railties
See https://github.com/rails/rails/pull/3782
|
|
|
|
|
|
|
|
|
|
|
|
| |
- added tests to confirm establish_connection uses DATABASE_URL and
Rails.env correctly even when no arguments are passed in.
- updated rake db tasks to support DATABASE_URL, and added tests to
confirm correct behavior for these rake tasks. (Removed
establish_connection call from some tasks since in those cases
the :environment task already made sure the function would be called)
- updated Resolver so that when it resolves the database url, it
removes hash values with empty strings from the config spec (e.g.
to support connection to postgresql when no username is specified).
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
SOURCE_ANNOTATION_DIRECTORIES='dir1,dir2' bundle exec rake notes
Searches app, config, lib, script, test (default)
Also searches dir1, dir2
References: #4536, #4540
|
|
|
|
|
| |
Add separate tests to verify directories covered
Add tests to verify file_types
|
|
|
| |
css, scss and css.
|
|
|
|
| |
rails/rails@9299bfdcd387253d83b645c205b8df477f2d0940.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
reload_classes_only_on_change schema.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Scope in migrations can be defined by adding suffix in filename,
like: 01_a_migration.blog.rb. Such migration have blog scope.
Scope is automatically added while copying migrations from engine,
so if you want to revert all of the migrations from given engine,
you can just run db:migrate with SCOPE, like:
rake db:migrate SCOPE=blog
|
|
|
|
| |
railties/test/application/rake/migrations_test.rb
|
|
|