link Profile und Gremien an neuigkeit

This commit is contained in:
Andreas Stephanides
2014-04-23 17:15:59 +02:00
parent 63f3b09a5d
commit 73a2627cd3
8 changed files with 30 additions and 5 deletions

View File

@@ -29,7 +29,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","Studium","Fetprofile"]
LINKTYPES=["Thema", "Gallery", "Lva","Studium","Fetprofile", "Gremium"]
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
before_validation :sanitize
has_many :nlinks