0
0
Fork 0

order by id when the timestamp is equal

This can happen when multiple blog posts get inserted at once, so we
should order by id too.
This commit is contained in:
Gibheer 2014-01-16 09:00:18 +01:00
parent f05763ae18
commit dded05bb52
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ SQL
filter(:released => true).
select(:posts__id___post_id, :written, :title, :content, :username).
join(:accounts, :id___account_id => :account_id).
reverse_order(:written)
reverse_order(:written, :posts__id)
# return when a single posts has to be shown
return load_previous_and_next_post(session, posts) if session.options[:id]