2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-31 22:15:12 +00:00

fixup pool_posts:orig

--HG--
branch : moe
extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%4036
This commit is contained in:
petopeto
2010-08-26 21:25:42 +00:00
parent 70d401f2f9
commit 46be3dcee1

View File

@@ -139,14 +139,12 @@ module PostSqlMethods
end end
if q.has_key?(:pool) if q.has_key?(:pool)
if q.has_key?(:pool_posts) if q.has_key?(:pool_posts) and q[:pool_posts] == "all"
if q[:pool_posts] == "all"
conds << "(pools_posts.active OR pools_posts.master_id IS NOT NULL)" conds << "(pools_posts.active OR pools_posts.master_id IS NOT NULL)"
elsif q[:pool_posts] == "master" elsif q.has_key?(:pool_posts) and q[:pool_posts] == "master"
conds << "(pools_posts.master_id IS NOT NULL)" conds << "(pools_posts.master_id IS NOT NULL)"
elsif q[:pool_posts] == "slave" elsif q.has_key?(:pool_posts) and q[:pool_posts] == "slave"
conds << "(pools_posts.active AND pools_posts.slave_id IS NOT NULL)" conds << "(pools_posts.active AND pools_posts.slave_id IS NOT NULL)"
end
elsif q.has_key?(:pool_posts) && q[:pool_posts] == "orig" elsif q.has_key?(:pool_posts) && q[:pool_posts] == "orig"
conds << "pools_posts.active = true" conds << "pools_posts.active = true"
else else