@@ -91,21 +91,6 class Project < ActiveRecord::Base | |||||
91 | def identifier_frozen? |
|
91 | def identifier_frozen? | |
92 | errors[:identifier].nil? && !(new_record? || identifier.blank?) |
|
92 | errors[:identifier].nil? && !(new_record? || identifier.blank?) | |
93 | end |
|
93 | end | |
94 |
|
||||
95 | def issues_with_subprojects(include_subprojects=false) |
|
|||
96 | conditions = nil |
|
|||
97 | if include_subprojects |
|
|||
98 | ids = [id] + descendants.collect(&:id) |
|
|||
99 | conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"] |
|
|||
100 | end |
|
|||
101 | conditions ||= ["#{Project.table_name}.id = ?", id] |
|
|||
102 | # Quick and dirty fix for Rails 2 compatibility |
|
|||
103 | Issue.send(:with_scope, :find => { :conditions => conditions }) do |
|
|||
104 | Version.send(:with_scope, :find => { :conditions => conditions }) do |
|
|||
105 | yield |
|
|||
106 | end |
|
|||
107 | end |
|
|||
108 | end |
|
|||
109 |
|
94 | |||
110 | # returns latest created projects |
|
95 | # returns latest created projects | |
111 | # non public projects will be returned only if user is a member of those |
|
96 | # non public projects will be returned only if user is a member of those |
General Comments 0
You need to be logged in to leave comments.
Login now