diff options
author | rhenium <re4k@re4k.info> | 2013-06-01 00:39:56 +0900 |
---|---|---|
committer | rhenium <re4k@re4k.info> | 2013-06-01 00:39:56 +0900 |
commit | 0d228bd6dc1208b4a754047114362be7b1444ce4 (patch) | |
tree | f3112067c41ae3745a1bd056c03271e58b6efd1b | |
parent | ddf6948fb5d1273e9fb3eda688d06f76402368b6 (diff) | |
download | aclog-0d228bd6dc1208b4a754047114362be7b1444ce4.tar.gz |
fix search
-rw-r--r-- | app/controllers/search_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 0ed404a..42ef707 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -3,6 +3,7 @@ class SearchController < ApplicationController def search @caption = "search" - @tweets = Tweet.recent(7).parse_query(params[:query] || "").reacted.order_by_id.list(params, force_page: true) + @tweets = Tweet.parse_query(params[:query] || "").reacted.order_by_id.list(params, force_page: true) + @tweets = @tweets.recent(7) unless @tweets.to_sql.include?("`tweets`.`id`") end end |