From 7d1f295e1852d7032bfde2e66469d9122a33fe1a Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 6 Jun 2013 13:02:25 +0600 Subject: [PATCH] [#42] add aliase to table in the sql request --- app/controllers/api/v1/issues_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/issues_controller.rb b/app/controllers/api/v1/issues_controller.rb index 37218b0b0..d6c712c02 100644 --- a/app/controllers/api/v1/issues_controller.rb +++ b/app/controllers/api/v1/issues_controller.rb @@ -64,9 +64,9 @@ class Api::V1::IssuesController < Api::V1::BaseController when 'none' @issues = @issues.where(:assigned_id => nil) when '*' - @issues = @issues.where('assigned_id IS NOT NULL') + @issues = @issues.where('issues.assigned_id IS NOT NULL') else - @issues = @issues.where('assignees_issues.uname = ?', params[:assignee]) + @issues = @issues.where('issues.assignees_issues.uname = ?', params[:assignee]) end end @@ -91,7 +91,7 @@ class Api::V1::IssuesController < Api::V1::BaseController direction = params[:direction] == 'asc' ? 'ASC' : 'DESC' @issues = @issues.order("#{sort} #{direction}") - @issues = @issues.where('created_at >= to_timestamp(?)', params[:since]) if params[:since] =~ /\A\d+\z/ + @issues = @issues.where('issues.created_at >= to_timestamp(?)', params[:since]) if params[:since] =~ /\A\d+\z/ @issues.paginate(paginate_params) render :index end