From f5c5393d09d5a9891ddd8cddd5e47fabb214f8a0 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 01:08:09 +0000 Subject: [PATCH] Rails4: replace deprecated #connection from Project model DEPRECATION WARNING: #connection is deprecated in favour of accessing it via the class. git-svn-id: http://svn.redmine.org/redmine/trunk@12719 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index fc7db9ea5..e2792c4ee 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -492,7 +492,7 @@ class Project < ActiveRecord::Base # Deletes all project's members def delete_all_members me, mr = Member.table_name, MemberRole.table_name - connection.delete("DELETE FROM #{mr} WHERE #{mr}.member_id IN (SELECT #{me}.id FROM #{me} WHERE #{me}.project_id = #{id})") + ActiveRecord::Base.connection.delete("DELETE FROM #{mr} WHERE #{mr}.member_id IN (SELECT #{me}.id FROM #{me} WHERE #{me}.project_id = #{id})") Member.delete_all(['project_id = ?', id]) end -- 2.39.5