From dc1eba3d8686c329b4116662efcbc66fa42a1a2b Mon Sep 17 00:00:00 2001 From: pavel Date: Fri, 8 Sep 2017 15:03:34 +0200 Subject: [PATCH] delete_all with args is deprecated --- extra/xapian_indexer.rb | 2 +- lib/redmine_dmsf/patches/user_patch.rb | 2 +- lib/tasks/dmsf_maintenance.rake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/xapian_indexer.rb b/extra/xapian_indexer.rb index 148206c9..e7280dfd 100644 --- a/extra/xapian_indexer.rb +++ b/extra/xapian_indexer.rb @@ -224,7 +224,7 @@ def update_log(repository, changeset, status, message = nil) end def delete_log(repository) - Indexinglog.delete_all(:repository_id => repository.id) + Indexinglog.where(:repository_id => repository.id).delete_all log "Log for repo #{repo_name(repository)} removed!" end diff --git a/lib/redmine_dmsf/patches/user_patch.rb b/lib/redmine_dmsf/patches/user_patch.rb index 1c61e38f..e4d592f7 100644 --- a/lib/redmine_dmsf/patches/user_patch.rb +++ b/lib/redmine_dmsf/patches/user_patch.rb @@ -43,7 +43,7 @@ module RedmineDmsf DmsfFolder.where(:deleted_by_user_id => id).update_all(:deleted_by_user_id => substitute.id) DmsfLink.where(:user_id => id).update_all(:user_id => substitute.id) DmsfLink.where(:deleted_by_user_id => id).update_all(:deleted_by_user_id => substitute.id) - DmsfLock.delete_all(:user_id => id) + DmsfLock.where(:user_id => id).delete_all DmsfWorkflowStepAction.where(:author_id => id).update_all(:author_id => substitute.id) DmsfWorkflowStepAssignment.where(:user_id => id).update_all(:user_id => substitute.id) DmsfWorkflowStep.where(:user_id => id).update_all(:user_id => substitute.id) diff --git a/lib/tasks/dmsf_maintenance.rake b/lib/tasks/dmsf_maintenance.rake index 16b8f2d8..cc9b28b3 100644 --- a/lib/tasks/dmsf_maintenance.rake +++ b/lib/tasks/dmsf_maintenance.rake @@ -88,7 +88,7 @@ class DmsfMaintenance puts "#{number_to_human_size(size)} has been released\n\n" # Links size = DmsfLink.where(:project_id => -1).count - DmsfLink.delete_all(:project_id => -1) + DmsfLink.where(:project_id => -1).delete_all puts "#{size} links have been deleted.\n\n" end