travis-ci
1597 of 2247 relevant lines covered (71.07%)
21.96 hits per line
1 |
class Other < Notice |
1✔ |
2 |
MASK = 'REDACTED'.freeze |
1✔ |
3 |
REDACTION_REGEX = /google/i |
1✔ |
4 |
|
|
5 |
define_elasticsearch_mapping(works: [:description]) |
1✔ |
6 |
|
|
7 |
def self.model_name |
1✔ |
8 |
Notice.model_name
|
5✔ |
9 |
end
|
|
10 |
|
|
11 |
def to_partial_path |
1✔ |
12 |
'notices/notice'
|
1✔ |
13 |
end
|
|
14 |
|
|
15 |
def sender_name |
1✔ |
16 |
if hide_identities?
|
2✔ |
17 |
MASK
|
2✔ |
18 |
else
|
|
19 |
super
|
× |
20 |
end
|
|
21 |
end
|
|
22 |
|
|
23 |
def principal_name |
1✔ |
24 |
if hide_identities?
|
2✔ |
25 |
MASK
|
2✔ |
26 |
else
|
|
27 |
super
|
× |
28 |
end
|
|
29 |
end
|
|
30 |
|
|
31 |
def hide_identities? |
1✔ |
32 |
(recipient_name =~ REDACTION_REGEX).present?
|
3✔ |
33 |
end
|
|
34 |
end
|