Fix deprecation: insert_sql is deprecated and will be removed

This commit is contained in:
Jasper Maes 2018-12-19 19:39:10 +01:00
parent bf38936fb3
commit 01185be027
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
title: 'Fix deprecation: insert_sql is deprecated and will be removed'
merge_request: 23944
author: Jasper Maes
type: other

View file

@ -46,7 +46,7 @@ class CreateMissingNamespaceForInternalUsers < ActiveRecord::Migration[4.2]
end
insert_query = "INSERT INTO namespaces(owner_id, path, name, created_at, updated_at) VALUES(#{user_id}, '#{path}', '#{path}', NOW(), NOW())"
namespace_id = connection.insert_sql(insert_query)
namespace_id = connection.insert(insert_query)
create_route(namespace_id)
end