mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
appease the Cyber Canine 9000
This commit is contained in:
parent
1c546bc0bb
commit
434d176ebe
1 changed files with 12 additions and 10 deletions
|
@ -1,18 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ModerationHelper
|
||||
# @param report [Report]
|
||||
def content_url(report)
|
||||
target = report.target
|
||||
case report.type
|
||||
when 'Reports::Answer'
|
||||
answer_path target.user.screen_name, target.id
|
||||
when 'Reports::Comment'
|
||||
answer_path target.answer.user.screen_name, target.answer.id
|
||||
when 'Reports::Question'
|
||||
question_path 'user', target.id
|
||||
when 'Reports::User'
|
||||
user_path target
|
||||
else
|
||||
'#'
|
||||
when "Reports::Answer"
|
||||
answer_path target.user.screen_name, target.id
|
||||
when "Reports::Comment"
|
||||
answer_path target.answer.user.screen_name, target.answer.id
|
||||
when "Reports::Question"
|
||||
question_path "user", target.id
|
||||
when "Reports::User"
|
||||
user_path target
|
||||
else
|
||||
"#"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue