From 500a656d6bf87630590191bdc33ce1ee7bcf3c3d Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 5 Apr 2011 04:15:19 +0800 Subject: [PATCH] Mod: Unknow fix in server --- app/controllers/home_controller.rb | 7 +++++-- app/views/logs/_log.html.erb | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index df95367..c53b62d 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -23,8 +23,8 @@ def index end def newbie - ask_logs = Log.any_of({:_type => "AskLog"}, {:_type => "UserLog", :action.in => ["FOLLOW_ASK", "UNFOLLOW_ASK"]}).where(:created_at.gte => (Time.now - 1.day)) - answer_logs = Log.any_of({:_type => "AnswerLog"}, {:_type => "UserLog", :action => "AGREE"}).where(:created_at.gte => (Time.now - 1.day)) + ask_logs = Log.any_of({:_type => "AskLog"}, {:_type => "UserLog", :action.in => ["FOLLOW_ASK", "UNFOLLOW_ASK"]}).where(:created_at.gte => (Time.now - 2.hours)) + answer_logs = Log.any_of({:_type => "AnswerLog"}, {:_type => "UserLog", :action => "AGREE"}).where(:created_at.gte => (Time.now - 2.hours)) @asks = Ask.any_of({:_id.in => ask_logs.map {|l| l.target_id}.uniq}, {:_id.in => answer_logs.map {|l| l.target_parent_id}.uniq}).desc("answers_count") h = {} @hot_topics = @asks.inject([]) { |memo, ask| @@ -33,6 +33,9 @@ def newbie @hot_topics.delete("者也") @hot_topics.delete("知乎") @hot_topics.delete("反馈") + @hot_topics.delete("zheye") + @hot_topics.delete("Quora") + @hot_topics.delete("quora") @hot_topics.each { |str| h[str] = (h[str] || 0) + 1 diff --git a/app/views/logs/_log.html.erb b/app/views/logs/_log.html.erb index 9b78af3..eed7409 100644 --- a/app/views/logs/_log.html.erb +++ b/app/views/logs/_log.html.erb @@ -9,7 +9,6 @@ when "AskLog"
<% case action - when "NEW" %> <% when "ADD_TOPIC", "DEL_TOPIC","EDIT" %>