studium nlink added

This commit is contained in:
Andreas Stephanides
2014-04-05 12:46:32 +02:00
parent b73f456f45
commit 4c9a3c8999
3 changed files with 8 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ class Neuigkeit < ActiveRecord::Base
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
LINKTYPES=["Thema", "Gallery", "Lva"]
LINKTYPES=["Thema", "Gallery", "Lva","Studium"]
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
before_validation :sanitize
has_many :nlinks