Project

General

Profile

Feature #6641 » do_not_filter_out_all_system_activities_when_a_noninherited_project_specific_activity_exists.patch

fix to backend so that it doesn't filter out all enumerations with parent == nil - Albert Rosenfield, 2010-10-25 17:06

View differences:

app/models/project.rb 2010-10-18 20:00:04.042272239 +0200 → app/models/project.rb 2010-10-18 20:42:19.582311011 +0200
707 707

  
708 708
  # Returns the systemwide active activities merged with the project specific overrides
709 709
  def system_activities_and_project_overrides(include_inactive=false)
710
    direct_parents = self.time_entry_activities.collect(&:parent_id).reject{|a| a == nil}
710 711
    if include_inactive
711 712
      return TimeEntryActivity.shared.
712
        find(:all,
713
             :conditions => ["id NOT IN (?)", self.time_entry_activities.collect(&:parent_id)]) +
713
        reject{|a| direct_parents.include?(a.id)} +
714 714
        self.time_entry_activities
715 715
    else
716 716
      return TimeEntryActivity.shared.active.
717
        find(:all,
718
             :conditions => ["id NOT IN (?)", self.time_entry_activities.collect(&:parent_id)]) +
717
        reject{|a| direct_parents.include?(a.id)} +
719 718
        self.time_entry_activities.active
720 719
    end
721 720
  end
(2-2/2)