From 48487b80acc01d4f47223bd8b44270c547067ab5 Mon Sep 17 00:00:00 2001 From: nccu Date: Tue, 17 Mar 2015 15:51:19 +0800 Subject: [PATCH] fix postdate --- app/controllers/admin/bulletins_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/admin/bulletins_controller.rb b/app/controllers/admin/bulletins_controller.rb index 96d5a0c..464da9c 100644 --- a/app/controllers/admin/bulletins_controller.rb +++ b/app/controllers/admin/bulletins_controller.rb @@ -23,6 +23,7 @@ class Admin::BulletinsController < ApplicationController bulletins = bulletins.where(:tagged_ids.in => params[:tags]) if !params[:tags].blank? bulletins = bulletins.where(:is_preview.in=>[false,nil]) bulletins = bulletins.where(:approved.ne => false , :rejected.ne => true) + bulletins = bulletins.where(:postdate.lt=>Time.now) bulletins = bulletins.desc( :is_top, :postdate).page(page_num).per(per_page) @@ -84,6 +85,7 @@ class Admin::BulletinsController < ApplicationController end bulletin_count = bulletin_count.where(:is_preview.in=>[false,nil]) bulletin_count = bulletin_count.where(:approved.ne => false , :rejected.ne => true) + bulletin_count = bulletin_count.where(:postdate.lt=>Time.now) total_pages = bulletin_count.count # End