AutoCommit Don Aug 27 14:03:04 CEST 2015
This commit is contained in:
@@ -21,7 +21,7 @@ class Calentry < ActiveRecord::Base
|
||||
validates :typ, :presence => true
|
||||
before_save :get_public
|
||||
belongs_to :object, polymorphic: true, touch: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
||||
|
||||
scope :of_month,(d) -> {where("start >= ? AND start <= ?", d.beginning_of_month, d.end_of_month)}
|
||||
scope :upcoming, ->{ where("start >= ?", Time.now).order(:start)}
|
||||
scope :recent,-> { where("start <= ?", Time.now).order(:start).reverse_order}
|
||||
validate do |entry|
|
||||
|
||||
Reference in New Issue
Block a user