13208: Refactor permission checking to improve query performance
[arvados.git] / services / api / lib / sweep_trashed_collections.rb
index 84497a179dc06e24792a196cc053261eeaa31786..a899191db014286c40ea2a5bca5373b3768e3191 100644 (file)
@@ -9,10 +9,10 @@ module SweepTrashedCollections
 
   def self.sweep_now
     act_as_system_user do
-      Collection.unscoped.
+      Collection.
         where('delete_at is not null and delete_at < statement_timestamp()').
         destroy_all
-      Collection.unscoped.
+      Collection.
         where('is_trashed = false and trash_at < statement_timestamp()').
         update_all('is_trashed = true')
     end