2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-08-02 19:53:48 -04:00
|
|
|
module Jobs
|
|
|
|
class CheckOutOfDateThemes < Jobs::Scheduled
|
|
|
|
every 1.day
|
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
target_themes = RemoteTheme
|
|
|
|
.joins("JOIN themes ON themes.remote_theme_id = remote_themes.id")
|
|
|
|
.where.not(remote_url: "")
|
|
|
|
|
|
|
|
target_themes.each do |remote|
|
|
|
|
remote.update_remote_version
|
|
|
|
remote.save!
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|