diff --git a/app/models/post/sql_methods.rb b/app/models/post/sql_methods.rb index 07addf83..c93506dc 100644 --- a/app/models/post/sql_methods.rb +++ b/app/models/post/sql_methods.rb @@ -139,8 +139,14 @@ module PostSqlMethods end if q.has_key?(:pool) - if q.has_key?(:pool_posts) && q[:pool_posts] == "all" - conds << "(pools_posts.active OR pools_posts.master_id IS NOT NULL)" + if q.has_key?(:pool_posts) + if q[:pool_posts] == "all" + conds << "(pools_posts.active OR pools_posts.master_id IS NOT NULL)" + elsif q[:pool_posts] == "master" + conds << "(pools_posts.master_id IS NOT NULL)" + elsif q[:pool_posts] == "slave" + conds << "(pools_posts.active AND pools_posts.slave_id IS NOT NULL)" + end elsif q.has_key?(:pool_posts) && q[:pool_posts] == "orig" conds << "pools_posts.active = true" else