2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-28 12:20:05 -04:00
|
|
|
module Jobs
|
|
|
|
|
2019-10-02 00:01:53 -04:00
|
|
|
class RetroGrantAnniversary < ::Jobs::Onceoff
|
2017-04-28 12:20:05 -04:00
|
|
|
def execute_onceoff(args)
|
|
|
|
return unless SiteSetting.enable_badges
|
|
|
|
|
|
|
|
# Fill in the years of anniversary badges we missed
|
|
|
|
(2..3).each do |year|
|
2019-10-14 06:03:22 -04:00
|
|
|
::Jobs::GrantAnniversaryBadges.new.execute(start_date: year.years.ago)
|
2017-04-28 12:20:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|