posts: hotfix bug in /posts.json?tags=blah+order:random.
This commit is contained in:
@@ -137,7 +137,7 @@ module PostSets
|
|||||||
end
|
end
|
||||||
|
|
||||||
# XXX HACK: uploader_name is needed in api responses and in data-uploader attribs (visible to mods only).
|
# XXX HACK: uploader_name is needed in api responses and in data-uploader attribs (visible to mods only).
|
||||||
temp = temp.includes(:uploader) if format.to_sym != :html || CurrentUser.is_moderator?
|
temp = temp.includes(:uploader) if !is_random? && (format.to_sym != :html || CurrentUser.is_moderator?)
|
||||||
|
|
||||||
temp.each # hack to force rails to eager load
|
temp.each # hack to force rails to eager load
|
||||||
temp
|
temp
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
|
|
||||||
get posts_path, params: { random: "1" }
|
get posts_path, params: { random: "1" }
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
|
get posts_path(format: :json), params: { random: "1" }
|
||||||
|
assert_response :success
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user