aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorrhenium <re4k@re4k.info>2013-06-01 00:39:56 +0900
committerrhenium <re4k@re4k.info>2013-06-01 00:39:56 +0900
commit0d228bd6dc1208b4a754047114362be7b1444ce4 (patch)
treef3112067c41ae3745a1bd056c03271e58b6efd1b /app
parentddf6948fb5d1273e9fb3eda688d06f76402368b6 (diff)
downloadaclog-0d228bd6dc1208b4a754047114362be7b1444ce4.tar.gz
fix search
Diffstat (limited to 'app')
-rw-r--r--app/controllers/search_controller.rb3
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