2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-31 05:55:11 +00:00

add portrait_pool order; this is only meant to be used internally by pool/show

--HG--
branch : moe
extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%40456
This commit is contained in:
petopeto
2010-11-18 20:22:08 +00:00
parent c98226d36c
commit ff1dffe5c6

View File

@@ -307,6 +307,12 @@ module PostSqlMethods
when "landscape"
sql << " ORDER BY 1.0*width/GREATEST(1, height) DESC"
when "portrait_pool"
# We can only do this if we're searching for a pool.
if q.has_key?(:pool) then
sql << " ORDER BY 1.0*width / GREATEST(1, height), nat_sort(pools_posts.sequence), pools_posts.post_id"
end
when "change", "change_asc"
sql << " ORDER BY change_seq"