fix from messy search

This commit is contained in:
Matthew K. Fu JuYuan 2012-07-09 16:48:23 +08:00
parent 09d46f2f75
commit 773371e885
3 changed files with 4 additions and 3 deletions

View File

@ -60,6 +60,7 @@ class PagesController < ApplicationController
def get_item def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]}) module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
#TODO 需要做 error handler 處理沒有新增該模組頁面導致錯誤的可能性
end end
end end

View File

@ -5,7 +5,7 @@ class Bulletin
include Mongoid::Timestamps include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes include Mongoid::MultiParameterAttributes
include Impressionist::Impressionable include Impressionist::Impressionable
include NccuSearch # include NccuSearch
scope :searchable,where(:is_checked=>true,:is_hidden=>false,:is_pending=>false) scope :searchable,where(:is_checked=>true,:is_hidden=>false,:is_pending=>false)

View File

@ -5,8 +5,8 @@ class NewsBulletin
include Mongoid::Timestamps include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes include Mongoid::MultiParameterAttributes
include Impressionist::Impressionable include Impressionist::Impressionable
include Tire::Model::Search # include Tire::Model::Search
include Tire::Model::Callbacks # include Tire::Model::Callbacks
# include Redis::Objects # include Redis::Objects