Merge branch 'master' of github.com:fetsite/fetsite

This commit is contained in:
Andreas Stephanides
2015-03-03 20:06:14 +01:00
6 changed files with 17 additions and 7 deletions

View File

@@ -28,7 +28,8 @@ class Neuigkeit < ActiveRecord::Base
default_scope order(:cache_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)}