aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2018-01-24 21:53:01 +1030
committerGitHub <noreply@github.com>2018-01-24 21:53:01 +1030
commitee1fda121effe791676460d72cf1bcaafe052e22 (patch)
treef370f9758c8f9732cafc505a6ea54662d6bc7530 /activerecord/lib
parentbc26f303705d6202c1ba3d6b1a9cfd2160d74cd8 (diff)
parent1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d (diff)
downloadrails-ee1fda121effe791676460d72cf1bcaafe052e22.tar.gz
rails-ee1fda121effe791676460d72cf1bcaafe052e22.tar.bz2
rails-ee1fda121effe791676460d72cf1bcaafe052e22.zip
Merge pull request #31773 from dinahshi/postgresql_bulk_patch
Postgresql bulk_change_table should flatten procs array
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
index b9d2f4da39..8678fab2ac 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -375,7 +375,7 @@ module ActiveRecord
if respond_to?(method, true)
sqls, procs = Array(send(method, table, *arguments)).partition { |v| v.is_a?(String) }
sql_fragments << sqls
- non_combinable_operations << procs if procs.present?
+ non_combinable_operations.concat(procs)
else
execute "ALTER TABLE #{quote_table_name(table_name)} #{sql_fragments.join(", ")}" unless sql_fragments.empty?
non_combinable_operations.each(&:call)