Sha256: f4b5e8e6d2af1c871eb0b0b8ee36ce54661444b3ff9e93e70796cba4aabab98f
Contents?: true
Size: 421 Bytes
Versions: 10
Compression:
Stored size: 421 Bytes
Contents
require_relative 'methods' class Team < ActiveRecord::Base include Methods def self.purge!(dt = 2.weeks.ago) Team.where(active: false).where('updated_at <= ?', dt).each do |team| begin logger.info "Destroying #{team}, inactive since #{team.updated_at}." team.destroy rescue StandardError => e logger.warn "Error destroying #{team}, #{e.message}." end end end end
Version data entries
10 entries across 10 versions & 1 rubygems