Sha256: 9af6d441ed17d6e4bed4b926acac4a6fce56ab918117a987b709aa133edbbe09
Contents?: true
Size: 348 Bytes
Versions: 12
Compression:
Stored size: 348 Bytes
Contents
require_relative 'methods' class Team < ActiveRecord::Base include Methods def self.purge! # destroy teams inactive for two weeks Team.where(active: false).where('updated_at <= ?', 2.weeks.ago).each do |team| puts "Destroying #{team}, inactive since #{team.updated_at}, over two weeks ago." team.destroy end end end
Version data entries
12 entries across 12 versions & 1 rubygems