From d4f2ec7bc94b3c4c61b9f9ad6bc1fc534c963ba9 Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 3 Dec 2013 23:03:50 -0500 Subject: [PATCH] Make Pool#posts return an array instead of arel fixes #2042 --- app/models/pool.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/pool.rb b/app/models/pool.rb index 86c483297..977b5c79a 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -241,9 +241,11 @@ class Pool < ActiveRecord::Base limit = options[:limit] || Danbooru.config.posts_per_page slice = post_id_array.slice(offset, limit) if slice && slice.any? - Post.where("id in (?)", slice).order(arbitrary_sql_order_clause(slice, "posts")) + slice.map do |id| + Post.find(id) + end else - Post.where("false") + [] end end