Make Pool#posts return an array instead of arel

fixes #2042
This commit is contained in:
Toks
2013-12-03 23:03:50 -05:00
parent 01d744d3a7
commit d4f2ec7bc9

View File

@@ -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