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
This commit is contained in:
parent
b1d0107ac0
commit
f5c5393d09
|
@ -492,7 +492,7 @@ class Project < ActiveRecord::Base
|
||||||
# Deletes all project's members
|
# Deletes all project's members
|
||||||
def delete_all_members
|
def delete_all_members
|
||||||
me, mr = Member.table_name, MemberRole.table_name
|
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])
|
Member.delete_all(['project_id = ?', id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue