From f060e78b8ffe376bd4b49698ee0e3a5f330c7d0c Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 16 Jun 2014 20:07:52 -0400 Subject: [PATCH] fix #2196 --- 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 f3671b42f..ef4a8ccfd 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -116,7 +116,7 @@ class PostsController < ApplicationController end def random - count = Post.fast_count(params[:tags]) + count = Post.fast_count(params[:tags], :statement_timeout => CurrentUser.user.statement_timeout) @post = Post.tag_match(params[:tags]).offset(rand(count)).first raise ActiveRecord::RecordNotFound if @post.nil? redirect_to post_path(@post, :tags => params[:tags])