#2415 remove ordering from random post link

This commit is contained in:
Toks
2015-06-22 14:23:59 -04:00
parent b60098044b
commit eb560be34b

View File

@@ -99,7 +99,7 @@ class PostsController < ApplicationController
def random
count = Post.fast_count(params[:tags], :statement_timeout => CurrentUser.user.statement_timeout)
@post = Post.tag_match(params[:tags]).offset(rand(count)).first
@post = Post.tag_match(params[:tags]).reorder("").offset(rand(count)).first
raise ActiveRecord::RecordNotFound if @post.nil?
redirect_to post_path(@post, :tags => params[:tags])
end