##// END OF EJS Templates
deprecated children_count replaced...
Jean-Philippe Lang -
r185:c38a2112c6eb
parent child
Show More
@@ -79,7 +79,7 class ProjectsController < ApplicationController
79 def show
79 def show
80 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
80 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
81 @members = @project.members.find(:all, :include => [:user, :role])
81 @members = @project.members.find(:all, :include => [:user, :role])
82 @subprojects = @project.children if @project.children_count > 0
82 @subprojects = @project.children if @project.children.size > 0
83 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
83 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
84 @trackers = Tracker.find(:all)
84 @trackers = Tracker.find(:all)
85 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
85 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
@@ -65,6 +65,6 class Project < ActiveRecord::Base
65 protected
65 protected
66 def validate
66 def validate
67 errors.add(parent_id, " must be a root project") if parent and parent.parent
67 errors.add(parent_id, " must be a root project") if parent and parent.parent
68 errors.add_to_base("A project with subprojects can't be a subproject") if parent and projects_count > 0
68 errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
69 end
69 end
70 end
70 end
@@ -19,7 +19,7
19 <td><%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %>
19 <td><%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %>
20 <td><%=h project.description %>
20 <td><%=h project.description %>
21 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
21 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
22 <td align="center"><%= project.children_count %>
22 <td align="center"><%= project.children.size %>
23 <td align="center"><%= format_date(project.created_on) %>
23 <td align="center"><%= format_date(project.created_on) %>
24 <td align="center">
24 <td align="center">
25 <%= button_to l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => "button-small" %>
25 <%= button_to l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => "button-small" %>
General Comments 0
You need to be logged in to leave comments. Login now