Class: ArticlesCacheWorker
- Inherits:
-
Object
- Object
- ArticlesCacheWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- app/worker/articles_cache_worker.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
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 #cache leeren Article.active.each do |article| article.updated_at = Time.now article.save end #Alte Versionen von has_paper_trail löschen (https://github.com/airblade/paper_trail) if ActiveRecord::Base.connection.table_exists?("settings") if Setting.for_key("rdcms.remove_old_versions.active") == "true" weekcount = Setting.for_key("rdcms.remove_old_versions.weeks").to_i Version.delete_all ["created_at < ?", weekcount.weeks.ago] end end end |