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
# 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