travis-ci
59 of 59 new or added lines in 1 file covered. (100.0%)
968 of 3604 relevant lines covered (26.86%)
53.73 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
class Defamation < Notice |
× |
4 |
MASK = 'REDACTED' |
× |
5 |
REDACTION_REGEX = /google/i |
× |
6 |
|
|
7 |
define_elasticsearch_mapping(works: [:description]) |
× |
8 |
|
|
9 |
def self.model_name |
× |
10 |
Notice.model_name
|
× |
11 |
end
|
× |
12 |
|
|
13 |
def to_partial_path |
× |
14 |
'notices/notice'
|
× |
15 |
end
|
× |
16 |
|
|
17 |
def sender_name |
× |
18 |
if hide_identities?
|
× |
19 |
MASK
|
× |
20 |
else
|
× |
21 |
super
|
× |
22 |
end
|
× |
23 |
end
|
× |
24 |
|
|
25 |
def principal_name |
× |
26 |
if hide_identities?
|
× |
27 |
MASK
|
× |
28 |
else
|
× |
29 |
super
|
× |
30 |
end
|
× |
31 |
end
|
× |
32 |
|
|
33 |
def hide_identities? |
× |
34 |
(recipient_name =~ REDACTION_REGEX).present?
|
× |
35 |
end
|
× |
36 |
end
|
× |