@@ -557,8 +557,8 class Query < ActiveRecord::Base | |||||
557 |
|
557 | |||
558 | joins = (order_option && order_option.include?('authors')) ? "LEFT OUTER JOIN users authors ON authors.id = #{Issue.table_name}.author_id" : nil |
|
558 | joins = (order_option && order_option.include?('authors')) ? "LEFT OUTER JOIN users authors ON authors.id = #{Issue.table_name}.author_id" : nil | |
559 |
|
559 | |||
560 | Issue.visible.find :all, :include => ([:status, :project] + (options[:include] || [])).uniq, |
|
560 | Issue.visible.scoped(:conditions => options[:conditions]).find :all, :include => ([:status, :project] + (options[:include] || [])).uniq, | |
561 |
:conditions => |
|
561 | :conditions => statement, | |
562 | :order => order_option, |
|
562 | :order => order_option, | |
563 | :joins => joins, |
|
563 | :joins => joins, | |
564 | :limit => options[:limit], |
|
564 | :limit => options[:limit], | |
@@ -582,8 +582,7 class Query < ActiveRecord::Base | |||||
582 | # Returns the versions |
|
582 | # Returns the versions | |
583 | # Valid options are :conditions |
|
583 | # Valid options are :conditions | |
584 | def versions(options={}) |
|
584 | def versions(options={}) | |
585 | Version.visible.find :all, :include => :project, |
|
585 | Version.visible.scoped(:conditions => options[:conditions]).find :all, :include => :project, :conditions => project_statement | |
586 | :conditions => Query.merge_conditions(project_statement, options[:conditions]) |
|
|||
587 | rescue ::ActiveRecord::StatementInvalid => e |
|
586 | rescue ::ActiveRecord::StatementInvalid => e | |
588 | raise StatementInvalid.new(e.message) |
|
587 | raise StatementInvalid.new(e.message) | |
589 | end |
|
588 | end |
General Comments 0
You need to be logged in to leave comments.
Login now