caching fuer neuigkeiten and bsp

This commit is contained in:
Andreas Stephanides
2015-03-06 16:41:08 +01:00
parent bd3c3a25e1
commit 8bf5583e00
5 changed files with 25 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ class Calentry < ActiveRecord::Base
validates :object, :presence => true
validates :typ, :presence => true
before_save :get_public
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
belongs_to :object, polymorphic: true, touch: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
scope :upcoming, ->{ where("start >= ?", Time.now).order(:start)}
scope :recent,-> { where("start <= ?", Time.now).order(:start).reverse_order}