Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 473
- Log:
Add simple topic title blacklist.
- Author:
- rool
- Date:
- Thu Jan 31 09:48:46 +0000 2019
- Size:
- 567 Bytes
1 | # 2019-01-26 (ADH): |
2 | # |
3 | # Very simplistic quick-and-dirty implementation; Blacklist has just one |
4 | # row, which contains a text field of newline separated items processed |
5 | # by Ruby when checking a post. Not efficient but sufficient for now. |
6 | # |
7 | class Blacklist < ActiveRecord::Base |
8 | |
9 | before_save :downcase_and_strip |
10 | |
11 | protected |
12 | |
13 | def downcase_and_strip |
14 | self.list = tidy(self.list) |
15 | self.title_list = tidy(self.title_list) |
16 | end |
17 | |
18 | private |
19 | |
20 | def tidy(text) |
21 | (text || '').split("\n").map { |item| item.strip.downcase }.join("\n") |
22 | end |
23 | |
24 | end |