fix published scope

This commit is contained in:
Andreas Stephanides
2015-03-09 00:42:18 +01:00
parent 8046b1ac7f
commit c9f58dea34

View File

@@ -29,7 +29,7 @@ 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 :published_scope, ->{where("datum <= ? OR datum IS NULL", Date.today)}
scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Date.today)}
scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)}
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}