Support for Ruby 2.0.0
This commit is contained in:
parent
545da39dd3
commit
2aef9bd71f
|
@ -17,18 +17,23 @@ class ModerationController < ApplicationController
|
|||
Report.where(deleted: false).each do |report|
|
||||
target = if report.target.is_a? User
|
||||
report.target
|
||||
else
|
||||
next if report.target.user.nil?
|
||||
elsif report.target.respond_to? :user
|
||||
report.target.user
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
next if target.nil?
|
||||
|
||||
@users[target] ||= 0
|
||||
@users[target] += 1
|
||||
end
|
||||
|
||||
@users = @users.sort_by do |k, v|
|
||||
v
|
||||
end.reverse.to_h
|
||||
end.reverse
|
||||
|
||||
Hash[@users]
|
||||
else
|
||||
@user_id = @user_id.to_i
|
||||
@type = 'all'
|
||||
|
|
Loading…
Reference in New Issue