From 35cb224fb67a2f1ac83a98d608406d49aa22275a Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 16 Mar 2014 11:19:31 +0100 Subject: [PATCH] beuigkeiten reihenfolge fix --- app/models/neuigkeit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 2a0f582..1660869 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -24,7 +24,7 @@ class Neuigkeit < ActiveRecord::Base has_many :calentries, as: :object mount_uploader :picture, PictureUploader scope :published, -> {where("datum <= ? AND datum IS NOT NULL", Time.now.to_date).order(:datum).reverse_order} - scope :recent, -> { published.order(:datum).reverse_order.limit(15)} + scope :recent, -> { published.limit(15)} 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}%")}