aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/loading_test.rb
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-10-02 01:21:37 +0900
committeryui-knk <spiketeika@gmail.com>2015-11-02 23:06:57 +0900
commita7beeb7faac405de0f78c39dbfb7240a584d0d10 (patch)
treec7b58555604d401eeabe1ea3cbf05e44c6dc31a0 /railties/test/application/loading_test.rb
parentab3510367bd4622f836374e5a37e54381ea72fc6 (diff)
downloadrails-a7beeb7faac405de0f78c39dbfb7240a584d0d10.tar.gz
rails-a7beeb7faac405de0f78c39dbfb7240a584d0d10.tar.bz2
rails-a7beeb7faac405de0f78c39dbfb7240a584d0d10.zip
Make `db:migrate:status` to render `1_some.rb` format migrate files.
`1_valid_people_have_last_names.rb` and `20150823202140_create_users.rb` are valid migration file name. But `1_valid_people_have_last_names.rb` is rendered as `********** NO FILE **********` when `rake db:migrate:status`. Fix to this bug, this commit includes * define some API private methdos and a Constant `match_to_migration_filename?`, `parse_migration_filename`, and `MigrationFilenameRegexp` * use these methods in `db:migrate:status` task Example: These files are in `db/migrate` * 1_valid_people_have_last_names.rb * 20150819202140_irreversible_migration.rb * 20150823202140_add_admin_flag_to_users.rb * 20150823202141_migration_tests.rb * 2_we_need_reminders.rb * 3_innocent_jointable.rb we can migrate all of them. Before ```shell $ bundle exec rake db:migrate:status ... Status Migration ID Migration Name -------------------------------------------------- up 001 ********** NO FILE ********** up 002 ********** NO FILE ********** up 003 ********** NO FILE ********** up 20150819202140 Irreversible migration up 20150823202140 Add admin flag to users up 20150823202141 Migration tests ``` After ```shell $ bundle exec rake db:migrate:status ... Status Migration ID Migration Name -------------------------------------------------- up 001 Valid people have last names up 002 We need reminders up 003 Innocent jointable up 20150819202140 Irreversible migration up 20150823202140 Add admin flag to users up 20150823202141 Migration tests ```
Diffstat (limited to 'railties/test/application/loading_test.rb')
0 files changed, 0 insertions, 0 deletions