jackdempsey/acts_as_commentable — Issue #22: calling recent generates wrong query
Author: mabid
Created: 2011-11-21 19:51:32+00:00
State: open

When calling project.comments.recent the following query is generate

SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 119 AND `comments`.`commentable_type` = 'Project' ORDER BY created_at ASC, created_at DESC

Why does it add ORDER_BY ASC before adding DESC.

if we call project.comments without any scope it generates following query

SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 119 AND `comments`.`commentable_type` = 'Project' ORDER BY created_at ASC