aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
diff options
context:
space:
mode:
authorDinah Shi <dinahshi28@gmail.com>2018-01-23 22:25:22 -0500
committerDinah Shi <dinahshi28@gmail.com>2018-01-23 22:25:22 -0500
commit1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d (patch)
tree1776abde34dfe075c5ab30743bdbf73009ee622f /activerecord/test/cases/migration_test.rb
parentdbff1cee55a13ec7b0f135618555c3714bfd597b (diff)
downloadrails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.tar.gz
rails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.tar.bz2
rails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.zip
Use concat to join procs arrays in bulk_change_table
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r--activerecord/test/cases/migration_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index a3ebc8070a..3a6b5b2a6f 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -866,7 +866,7 @@ if ActiveRecord::Base.connection.supports_bulk_alter?
classname = ActiveRecord::Base.connection.class.name[/[^:]*$/]
expected_query_count = {
"Mysql2Adapter" => 3, # one query for columns, one query for primary key, one query to do the bulk change
- "PostgreSQLAdapter" => 2, # one query for columns, one for bulk change
+ "PostgreSQLAdapter" => 3, # one query for columns, one for bulk change, one for comment
}.fetch(classname) {
raise "need an expected query count for #{classname}"
}
@@ -874,12 +874,13 @@ if ActiveRecord::Base.connection.supports_bulk_alter?
assert_queries(expected_query_count, ignore_none: true) do
with_bulk_change_table do |t|
t.change :name, :string, default: "NONAME"
- t.change :birthdate, :datetime
+ t.change :birthdate, :datetime, comment: "This is a comment"
end
end
assert_equal "NONAME", column(:name).default
assert_equal :datetime, column(:birthdate).type
+ assert_equal "This is a comment", column(:birthdate).comment
end
private