From eb560be34b9c13f04bc0078d2c5ff886e8548452 Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 22 Jun 2015 14:23:59 -0400 Subject: [PATCH] #2415 remove ordering from random post link --- app/controllers/posts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 422a372b9..44154e10c 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -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