diff --git a/lib/api/v1/comments.rb b/lib/api/v1/comments.rb index e6c52a0..42c6f4b 100644 --- a/lib/api/v1/comments.rb +++ b/lib/api/v1/comments.rb @@ -18,9 +18,9 @@ module API conditions = make_conditions_with_parameter(params) if params[:reference_id] - comments = environment.articles.find(params[:id]).comments.send("#{params.key?(:oldest) ? 'older_than' : 'newer_than'}", params[:reference_id]).find(:all, :conditions => conditions, :limit => limit, :order => "created_at DESC") + comments = environment.articles.find(params[:id]).comments.send("#{params.key?(:oldest) ? 'older_than' : 'newer_than'}", params[:reference_id]).reorder("created_at DESC").find(:all, :conditions => conditions, :limit => limit) else - comments = environment.articles.find(params[:id]).comments.find(:all, :conditions => conditions, :limit => limit, :order => "created_at DESC") + comments = environment.articles.find(params[:id]).comments.reorder("created_at DESC").find(:all, :conditions => conditions, :limit => limit) end present comments, :with => Entities::Comment -- libgit2 0.21.2