From b1d0107ac0fdc2c9d642d1045ff9ba4221e3d514 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 01:07:52 +0000 Subject: [PATCH] Rails4: replace deprecated #connection from Repository model DEPRECATION WARNING: #connection is deprecated in favour of accessing it via the class. git-svn-id: http://svn.redmine.org/redmine/trunk@12718 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 4d2ccefaa..9731501fa 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -424,10 +424,10 @@ class Repository < ActiveRecord::Base ci = "#{table_name_prefix}changesets_issues#{table_name_suffix}" cp = "#{table_name_prefix}changeset_parents#{table_name_suffix}" - connection.delete("DELETE FROM #{ch} WHERE #{ch}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") - connection.delete("DELETE FROM #{ci} WHERE #{ci}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") - connection.delete("DELETE FROM #{cp} WHERE #{cp}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") - connection.delete("DELETE FROM #{cs} WHERE #{cs}.repository_id = #{id}") + ActiveRecord::Base.connection.delete("DELETE FROM #{ch} WHERE #{ch}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") + ActiveRecord::Base.connection.delete("DELETE FROM #{ci} WHERE #{ci}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") + ActiveRecord::Base.connection.delete("DELETE FROM #{cp} WHERE #{cp}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})") + ActiveRecord::Base.connection.delete("DELETE FROM #{cs} WHERE #{cs}.repository_id = #{id}") clear_extra_info_of_changesets end