aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-06-22 08:48:37 -0400
committerGitHub <noreply@github.com>2017-06-22 08:48:37 -0400
commit55a443b847ccf37aa8fb62fbc827f5b540980dd9 (patch)
treec73412e57626394af985b1a0bc3983770d12df7e /guides
parent5de611afe63f9a30360d49db90e864d1d29dc283 (diff)
parent2dafc4be2285bc2cb32983be6f16296319b40e25 (diff)
downloadrails-55a443b847ccf37aa8fb62fbc827f5b540980dd9.tar.gz
rails-55a443b847ccf37aa8fb62fbc827f5b540980dd9.tar.bz2
rails-55a443b847ccf37aa8fb62fbc827f5b540980dd9.zip
Merge pull request #29524 from y-yagi/do_not_use_private_api_in_bug_report_templates
Do not use private API in bug report templates
Diffstat (limited to 'guides')
-rw-r--r--guides/bug_report_templates/active_record_migrations_gem.rb6
-rw-r--r--guides/bug_report_templates/active_record_migrations_master.rb6
2 files changed, 4 insertions, 8 deletions
diff --git a/guides/bug_report_templates/active_record_migrations_gem.rb b/guides/bug_report_templates/active_record_migrations_gem.rb
index 0c398e334a..00ba3c1cd6 100644
--- a/guides/bug_report_templates/active_record_migrations_gem.rb
+++ b/guides/bug_report_templates/active_record_migrations_gem.rb
@@ -48,16 +48,14 @@ end
class BugTest < Minitest::Test
def test_migration_up
- migrator = ActiveRecord::Migrator.new(:up, [ChangeAmountToAddScale])
- migrator.run
+ ChangeAmountToAddScale.migrate(:up)
Payment.reset_column_information
assert_equal "decimal(10,2)", Payment.columns.last.sql_type
end
def test_migration_down
- migrator = ActiveRecord::Migrator.new(:down, [ChangeAmountToAddScale])
- migrator.run
+ ChangeAmountToAddScale.migrate(:down)
Payment.reset_column_information
assert_equal "decimal(10,0)", Payment.columns.last.sql_type
diff --git a/guides/bug_report_templates/active_record_migrations_master.rb b/guides/bug_report_templates/active_record_migrations_master.rb
index 84a4b71909..52c9028b0f 100644
--- a/guides/bug_report_templates/active_record_migrations_master.rb
+++ b/guides/bug_report_templates/active_record_migrations_master.rb
@@ -48,16 +48,14 @@ end
class BugTest < Minitest::Test
def test_migration_up
- migrator = ActiveRecord::Migrator.new(:up, [ChangeAmountToAddScale])
- migrator.run
+ ChangeAmountToAddScale.migrate(:up)
Payment.reset_column_information
assert_equal "decimal(10,2)", Payment.columns.last.sql_type
end
def test_migration_down
- migrator = ActiveRecord::Migrator.new(:down, [ChangeAmountToAddScale])
- migrator.run
+ ChangeAmountToAddScale.migrate(:down)
Payment.reset_column_information
assert_equal "decimal(10,0)", Payment.columns.last.sql_type