From 5454cc40c5de850db7dfcef1e97f30c255299f22 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 22 Apr 2019 23:09:03 +0900 Subject: Avoid new string instance creation in `InsertAll#execute` --- activerecord/lib/active_record/insert_all.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/insert_all.rb b/activerecord/lib/active_record/insert_all.rb index 959e5bd4d7..f6577dcbc4 100644 --- a/activerecord/lib/active_record/insert_all.rb +++ b/activerecord/lib/active_record/insert_all.rb @@ -21,9 +21,9 @@ module ActiveRecord end def execute - message = "#{model} " - message += "Bulk " if inserts.many? - message += (on_duplicate == :update ? "Upsert" : "Insert") + message = +"#{model} " + message << "Bulk " if inserts.many? + message << (on_duplicate == :update ? "Upsert" : "Insert") connection.exec_query to_sql, message end -- cgit v1.2.3