diff options
author | Dinah Shi <dinahshi28@gmail.com> | 2018-01-23 22:25:22 -0500 |
---|---|---|
committer | Dinah Shi <dinahshi28@gmail.com> | 2018-01-23 22:25:22 -0500 |
commit | 1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d (patch) | |
tree | 1776abde34dfe075c5ab30743bdbf73009ee622f /activerecord/lib/active_record | |
parent | dbff1cee55a13ec7b0f135618555c3714bfd597b (diff) | |
download | rails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.tar.gz rails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.tar.bz2 rails-1d8266fc689d6ec4f9df2b4a64214c5dcc9b0b7d.zip |
Use concat to join procs arrays in bulk_change_table
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 2 |
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 a8895f8606..5e7bd4c871 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) |