update_all('is_trashed = true')
# Sweep expired tokens
- ApiClientAuthorization.
- where("expires_at <= statement_timestamp()").
- destroy_all
+ ActiveRecord::Base.connection.execute("DELETE from api_client_authorizations where expires_at <= statement_timestamp()")
end
end
def self.sweep_if_stale
- return if Rails.configuration.trash_sweep_interval <= 0
- exp = Rails.configuration.trash_sweep_interval.seconds
+ return if Rails.configuration.Collections.TrashSweepInterval <= 0
+ exp = Rails.configuration.Collections.TrashSweepInterval.seconds
need = false
Rails.cache.fetch('SweepTrashedObjects', expires_in: exp) do
need = true