fix neuigkeiten

This commit is contained in:
2015-03-03 18:12:22 +01:00
parent 8718a77e4f
commit 0d6e11299a
6 changed files with 17 additions and 7 deletions

View File

@@ -28,7 +28,8 @@ class Neuigkeit < ActiveRecord::Base
default_scope order(:datum).reverse_order
scope :recent, -> { published.limit(10)}
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
scope :unpublished, -> {where("datum > ? OR datum IS NULL", Date.today)}
scope :published_scope, ->{where("datum <= ? OR datum IS NULL", Date.today)}
scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)}
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}