method
bulk_change_table
rails latest stable - Class:
ActiveRecord::ConnectionAdapters
bulk_change_table(table_name, operations)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 295
def bulk_change_table(table_name, operations) #:nodoc:
sqls = operations.flat_map do |command, args|
table, arguments = args.shift, args
method = :"#{command}_for_alter"
if respond_to?(method, true)
send(method, table, *arguments)
else
raise "Unknown method called : #{method}(#{arguments.inspect})"
end
end.join(", ")
execute("ALTER TABLE #{quote_table_name(table_name)} #{sqls}")
end