Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@@ -11,19 +11,18 @@ class ScoreCalculator
}
end
def initialize(weightings=nil)
def initialize(weightings = nil)
@weightings = weightings || ScoreCalculator.default_score_weights
end
# Calculate the score for all posts based on the weightings
def calculate(opts=nil)
def calculate(opts = nil)
update_posts_score(opts)
update_posts_rank(opts)
update_topics_rank(opts)
update_topics_percent_rank(opts)
end
private
def update_posts_score(opts)
@@ -110,7 +109,6 @@ SQL
posts_required: SiteSetting.summary_posts_required,
score_required: SiteSetting.summary_score_threshold)
filter_topics(builder, opts)
builder.exec
@@ -131,7 +129,6 @@ SQL
builder.exec
end
def filter_topics(builder, opts)
return builder unless opts