@@ -609,12 +609,12 class Query < ActiveRecord::Base | |||||
609 |
|
609 | |||
610 | joins = (order_option && order_option.include?('authors')) ? "LEFT OUTER JOIN users authors ON authors.id = #{Issue.table_name}.author_id" : nil |
|
610 | joins = (order_option && order_option.include?('authors')) ? "LEFT OUTER JOIN users authors ON authors.id = #{Issue.table_name}.author_id" : nil | |
611 |
|
611 | |||
612 |
Issue.visible.scoped(:conditions => options[:conditions]). |
|
612 | Issue.visible.scoped(:conditions => options[:conditions]).scoped(:include => ([:status, :project] + (options[:include] || [])).uniq, | |
613 | :conditions => statement, |
|
613 | :conditions => statement, | |
614 | :order => order_option, |
|
614 | :order => order_option, | |
615 | :joins => joins, |
|
615 | :joins => joins, | |
616 | :limit => options[:limit], |
|
616 | :limit => options[:limit], | |
617 | :offset => options[:offset] |
|
617 | :offset => options[:offset]).find_ids | |
618 | rescue ::ActiveRecord::StatementInvalid => e |
|
618 | rescue ::ActiveRecord::StatementInvalid => e | |
619 | raise StatementInvalid.new(e.message) |
|
619 | raise StatementInvalid.new(e.message) | |
620 | end |
|
620 | end |
General Comments 0
You need to be logged in to leave comments.
Login now