Module: Mumuki::Domain::Status::Discussion
Defined Under Namespace
Modules: Closed, Opened, PendingReview, Solved
Constant Summary
collapse
- STATUSES =
[Opened, Closed, Solved, PendingReview]
Instance Method Summary
collapse
#==, #as_json, #dup, #to_i, #to_s, #to_sym
Instance Method Details
#reachable_statuses_for(user, discussion) ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/mumuki/domain/status/discussion/discussion.rb', line 29
def reachable_statuses_for(user, discussion)
if user.moderator_here?
reachable_statuses_for_moderator(discussion)
else
reachable_statuses_for_initiator(discussion)
end
end
|
#reachable_statuses_for_initiator ⇒ Object
21
22
23
|
# File 'lib/mumuki/domain/status/discussion/discussion.rb', line 21
def reachable_statuses_for_initiator(*)
[]
end
|
#reachable_statuses_for_moderator ⇒ Object
17
18
19
|
# File 'lib/mumuki/domain/status/discussion/discussion.rb', line 17
def reachable_statuses_for_moderator(*)
[]
end
|
#should_be_shown?(count, user) ⇒ Boolean
25
26
27
|
# File 'lib/mumuki/domain/status/discussion/discussion.rb', line 25
def should_be_shown?(count, user)
count > 0 || user&.moderator_here?
end
|