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
+6 -7
View File
@@ -16,7 +16,7 @@ class TopTopic < ActiveRecord::Base
# We don't have to refresh these as often
def self.refresh_older!
older_periods = periods - [:daily,:all]
older_periods = periods - [:daily, :all]
transaction do
older_periods.each do |period|
@@ -32,7 +32,6 @@ class TopTopic < ActiveRecord::Base
refresh_older!
end
def self.periods
@@periods ||= [:all, :yearly, :quarterly, :monthly, :weekly, :daily].freeze
end
@@ -203,11 +202,11 @@ class TopTopic < ActiveRecord::Base
def self.start_of(period)
case period
when :yearly then 1.year.ago
when :monthly then 1.month.ago
when :quarterly then 3.months.ago
when :weekly then 1.week.ago
when :daily then 1.day.ago
when :yearly then 1.year.ago
when :monthly then 1.month.ago
when :quarterly then 3.months.ago
when :weekly then 1.week.ago
when :daily then 1.day.ago
end
end