@need_or = false;\r
add_sql_query_param "status", @statuses\r
add_sql_query_param "severity", @severities\r
- add_sql_query_param "user_id", @review_authors\r
+ add_sql_query_param "reviews.user_id", @review_authors\r
+ add_sql_query_param "review_comments.user_id", @comment_authors\r
\r
- @reviews = Review.find :all, :conditions => [@conditions] + @values\r
+ @reviews = Review.find( :all, :order => "created_at DESC", :joins => :review_comments, :conditions => [@conditions] + @values ).uniq\r
end\r
\r
def add_sql_query_param ( field, search_params )\r