Work in progress, full page search

This commit is contained in:
Sam
2015-06-22 18:09:08 +10:00
parent b3e583faf3
commit 41e427bd2e
15 changed files with 108 additions and 18 deletions

View File

@ -452,10 +452,6 @@ class Search
# double wrapping so we get correct row numbers
post_sql = "SELECT *, row_number() over() row_number FROM (#{post_sql}) xxx"
# p Topic.exec_sql(post_sql).to_a
# puts post_sql
# p Topic.exec_sql("SELECT topic_id FROM topic_allowed_users WHERE user_id = 2").to_a
posts = Post.includes(:topic => :category)
.joins("JOIN (#{post_sql}) x ON x.id = posts.topic_id AND x.post_number = posts.post_number")
.order('row_number')