5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/worker/articles_cache_worker.rb', line 5
def perform
Goldencobra::Article.active.each do |article|
article.updated_at = Time.now
article.without_versioning :save
end
if ActiveRecord::Base.connection.table_exists?("goldencobra_settings")
if Goldencobra::Setting.for_key("goldencobra.remove_old_versions.active") == "true"
weekcount = Goldencobra::Setting.for_key("goldencobra.remove_old_versions.weeks").to_i
Version.delete_all ["created_at < ?", weekcount.weeks.ago]
end
end
end
|