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
# Returns the systemwide active activities merged with the project specific overrides
def system_activities_and_project_overrides(include_inactive=false)
direct_parents = self.time_entry_activities.collect(&:parent_id).reject{|a| a == nil}
if include_inactive
return TimeEntryActivity.shared.
find(:all,
:conditions => ["id NOT IN (?)", self.time_entry_activities.collect(&:parent_id)]) +
reject{|a| direct_parents.include?(a.id)} +
self.time_entry_activities
else
return TimeEntryActivity.shared.active.
find(:all,
:conditions => ["id NOT IN (?)", self.time_entry_activities.collect(&:parent_id)]) +
reject{|a| direct_parents.include?(a.id)} +
self.time_entry_activities.active
end
end
(2-2/2)