From 2679150ed45b6be974534f410e61416576ca0bd3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 31 Jan 2009 12:48:09 +0000 Subject: [PATCH] Removes Issue.visible_by git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2342 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 8 ++++---- app/models/issue.rb | 6 ------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5d90c92af..a75e4120a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -95,14 +95,14 @@ class ProjectsController < ApplicationController @trackers = @project.rolled_up_trackers cond = @project.project_condition(Setting.display_subprojects_issues?) - Issue.visible_by(User.current) do - @open_issues_by_tracker = Issue.count(:group => :tracker, + + @open_issues_by_tracker = Issue.visible.count(:group => :tracker, :include => [:project, :status, :tracker], :conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false]) - @total_issues_by_tracker = Issue.count(:group => :tracker, + @total_issues_by_tracker = Issue.visible.count(:group => :tracker, :include => [:project, :status, :tracker], :conditions => cond) - end + TimeEntry.visible_by(User.current) do @total_hours = TimeEntry.sum(:hours, :include => :project, diff --git a/app/models/issue.rb b/app/models/issue.rb index 84a3c8e3c..d333fe3cc 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -270,12 +270,6 @@ class Issue < ActiveRecord::Base @soonest_start ||= relations_to.collect{|relation| relation.successor_soonest_start}.compact.min end - def self.visible_by(usr) - with_scope(:find => { :conditions => Project.visible_by(usr) }) do - yield - end - end - def to_s "#{tracker} ##{id}: #{subject}" end