11require_relative 'methods'
22
3- class Team
4- include Mongoid ::Document
5- include Mongoid ::Timestamps
3+ module SlackRubyBotServer
4+ class Team
5+ include Mongoid ::Document
6+ include Mongoid ::Timestamps
67
7- field :team_id , type : String
8- field :name , type : String
9- field :domain , type : String
10- field :token , type : String
11- field :active , type : Boolean , default : true
8+ field :team_id , type : String
9+ field :name , type : String
10+ field :domain , type : String
11+ field :token , type : String
12+ field :active , type : Boolean , default : true
1213
13- include Methods
14+ include Methods
1415
15- def self . purge!
16- # destroy teams inactive for two weeks
17- Team . where ( active : false , :updated_at . lte => 2 . weeks . ago ) . each do |team |
18- Mongoid . logger . info "Destroying #{ team } , inactive since #{ team . updated_at } , over two weeks ago."
19- team . destroy
16+ def self . purge!
17+ # destroy teams inactive for two weeks
18+ SlackRubyBotServer ::Team . where ( active : false , :updated_at . lte => 2 . weeks . ago ) . each do |team |
19+ Mongoid . logger . info "Destroying #{ team } , inactive since #{ team . updated_at } , over two weeks ago."
20+ team . destroy
21+ end
2022 end
2123 end
22- end
24+ end
0 commit comments