Skip to content

Commit

Permalink
Avoid new string instance creation in InsertAll#execute
Browse files Browse the repository at this point in the history
  • Loading branch information
kamipo committed Apr 22, 2019
1 parent 70d6416 commit 5454cc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/insert_all.rb
Expand Up @@ -21,9 +21,9 @@ def initialize(model, inserts, on_duplicate:, returning: nil, unique_by: nil)
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

Expand Down

0 comments on commit 5454cc4

Please sign in to comment.