From 2855b72bb6f92f40088fa1ed118a97386f1d141b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 29 Oct 2014 13:44:17 +0100 Subject: [PATCH] fix public thema --- app/models/thema.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/thema.rb b/app/models/thema.rb index d880e94..997b88c 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -21,9 +21,9 @@ include Rails.application.routes.url_helpers validates :themengruppe, :presence => true validates :title, :presence => true validates :text, :presence => true - scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public") - default_scope order(:priority).reverse_order - scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} + scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true) + default_scope order("themen.priority").reverse_order + scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")} scope :outdated, -> {includes(:translations).where("thema_translations.updated_atI18n.t.locale) } translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true