summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-05-27 17:16:10 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-05-27 17:16:10 +0000
commitf3cc84b3437a1f5c26748f75bb5cc8b8bca2d719 (patch)
treeab6da5fd236250a913967ff8f443fd3bb48d25f2 /app/models/project.rb
parente5ac73b7dc80af4c70289cfad13e5e632bb92670 (diff)
downloadredmine-f3cc84b3437a1f5c26748f75bb5cc8b8bca2d719.tar.gz
redmine-f3cc84b3437a1f5c26748f75bb5cc8b8bca2d719.zip
Show subproject versions on the Roadmap.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3760 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 8d6303224..931f89b55 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -336,6 +336,13 @@ class Project < ActiveRecord::Base
end
end
end
+
+ # Returns a scope of the Versions on subprojects
+ def rolled_up_versions
+ @rolled_up_versions ||=
+ Version.scoped(:include => :project,
+ :conditions => ["#{Project.table_name}.lft >= ? AND #{Project.table_name}.rgt <= ? AND #{Project.table_name}.status = #{STATUS_ACTIVE}", lft, rgt])
+ end
# Returns a scope of the Versions used by the project
def shared_versions