diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index eaa33c969..964469649 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -75,12 +75,14 @@ class Project < ActiveRecord::Base conditions = nil if include_subprojects && !active_children.empty? ids = [id] + active_children.collect {|c| c.id} - conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"] + conditions = ["#{Project.table_name}.id IN (#{ids.join(',')})"] end - conditions ||= ["#{Issue.table_name}.project_id = ?", id] + conditions ||= ["#{Project.table_name}.id = ?", id] # Quick and dirty fix for Rails 2 compatibility Issue.send(:with_scope, :find => { :conditions => conditions }) do - yield + Version.send(:with_scope, :find => { :conditions => conditions }) do + yield + end end end |