mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Merge pull request #2674 from akshaymohite/optimization-fixes
renamed unused variables properly
This commit is contained in:
commit
22fbae8556
5 changed files with 22 additions and 22 deletions
|
@ -64,7 +64,7 @@ class AdminDashboardData
|
||||||
AdminDashboardData.new.problems
|
AdminDashboardData.new.problems
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(options = nil)
|
def as_json(_options = nil)
|
||||||
@json ||= {
|
@json ||= {
|
||||||
reports: REPORTS.map { |type| Report.find(type).as_json },
|
reports: REPORTS.map { |type| Report.find(type).as_json },
|
||||||
admins: User.admins.count,
|
admins: User.admins.count,
|
||||||
|
|
|
@ -10,7 +10,7 @@ class ErrorLog
|
||||||
"#{Rails.root}/log/#{Rails.env}_errors.log"
|
"#{Rails.root}/log/#{Rails.env}_errors.log"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.clear!(guid)
|
def self.clear!(_guid)
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ class IncomingLinksReport
|
||||||
@data = nil
|
@data = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(options = nil)
|
def as_json(_options = nil)
|
||||||
{
|
{
|
||||||
type: self.type,
|
type: self.type,
|
||||||
title: I18n.t("reports.#{self.type}.title"),
|
title: I18n.t("reports.#{self.type}.title"),
|
||||||
|
@ -18,7 +18,7 @@ class IncomingLinksReport
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.find(type, opts={})
|
def self.find(type, _opts = {})
|
||||||
report_method = :"report_#{type}"
|
report_method = :"report_#{type}"
|
||||||
return nil unless respond_to?(report_method)
|
return nil unless respond_to?(report_method)
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ class PostAction < ActiveRecord::Base
|
||||||
opts[:target_usernames] = if post_action_type == :notify_user
|
opts[:target_usernames] = if post_action_type == :notify_user
|
||||||
post.user.username
|
post.user.username
|
||||||
elsif post_action_type != :notify_moderators
|
elsif post_action_type != :notify_moderators
|
||||||
# this is a hack to allow a PM with no reciepients, we should think through
|
# this is a hack to allow a PM with no recipients, we should think through
|
||||||
# a cleaner technique, a PM with myself is valid for flagging
|
# a cleaner technique, a PM with myself is valid for flagging
|
||||||
'x'
|
'x'
|
||||||
end
|
end
|
||||||
|
@ -199,7 +199,7 @@ class PostAction < ActiveRecord::Base
|
||||||
PostCreator.new(user, opts).create.id
|
PostCreator.new(user, opts).create.id
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.act(user, post, post_action_type_id, opts={})
|
def self.act(user, post, post_action_type_id, opts = {})
|
||||||
related_post_id = create_message_for_post_action(user, post, post_action_type_id, opts)
|
related_post_id = create_message_for_post_action(user, post, post_action_type_id, opts)
|
||||||
staff_took_action = opts[:take_action] || false
|
staff_took_action = opts[:take_action] || false
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue