Class: Team
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Team
- Includes:
- Methods, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/slack-ruby-bot-server/models/team/mongoid.rb,
lib/slack-ruby-bot-server/models/team/activerecord.rb
Class Method Summary collapse
Class Method Details
.purge! ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/slack-ruby-bot-server/models/team/mongoid.rb', line 18 def self.purge! # destroy teams inactive for two weeks Team.where(active: false, :updated_at.lte => 2.weeks.ago).each do |team| Mongoid.logger.info "Destroying #{team}, inactive since #{team.updated_at}, over two weeks ago." team.destroy end end |