blob: 8f54fcc9597e96a9c809eca4fe984abed4f97638 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
module MessageProminence
def has_prominence
send :include, InstanceMethods
cattr_accessor :prominence_states
self.prominence_states = ['normal', 'hidden','requester_only']
validates_inclusion_of :prominence, :in => self.prominence_states
end
module InstanceMethods
def user_can_view?(user)
Ability.can_view_with_prominence?(self.prominence, self.info_request, user)
end
def indexed_by_search?
self.prominence == 'normal'
end
def all_can_view?
self.prominence == 'normal'
end
end
end
|