Changes misleading scopes on Enumeration.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3083 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
4bdfef4dc4
commit
d8c5549168
4 files changed
+11
-19
No files matched your search
@@ -21,11 +21,7 @@ class Project < ActiveRecord::Base
|
||||
STATUS_ARCHIVED = 9
|
||||
|
||||
# Specific overidden Activities
|
||||
has_many :time_entry_activities do
|
||||
def active
|
||||
find(:all, :conditions => {:active => true})
|
||||
end
|
||||
end
|
||||
has_many :time_entry_activities
|
||||
has_many :members, :include => [:user, :roles], :conditions => "#{User.table_name}.type='User' AND #{User.table_name}.status=#{User::STATUS_ACTIVE}"
|
||||
has_many :member_principals, :class_name => 'Member',
|
||||
:include => :principal,
|
||||
@@ -572,7 +568,7 @@ class Project < ActiveRecord::Base
|
||||
overridden_activity_ids = self.time_entry_activities.active.collect(&:parent_id)
|
||||
|
||||
if overridden_activity_ids.empty?
|
||||
return TimeEntryActivity.active
|
||||
return TimeEntryActivity.shared.active
|
||||
else
|
||||
return system_activities_and_project_overrides
|
||||
end
|
||||
@@ -584,7 +580,7 @@ class Project < ActiveRecord::Base
|
||||
overridden_activity_ids = self.time_entry_activities.collect(&:parent_id)
|
||||
|
||||
if overridden_activity_ids.empty?
|
||||
return TimeEntryActivity.all
|
||||
return TimeEntryActivity.shared
|
||||
else
|
||||
return system_activities_and_project_overrides(true)
|
||||
end
|
||||
@@ -593,12 +589,12 @@ class Project < ActiveRecord::Base
|
||||
# Returns the systemwide active activities merged with the project specific overrides
|
||||
def system_activities_and_project_overrides(include_inactive=false)
|
||||
if include_inactive
|
||||
return TimeEntryActivity.all.
|
||||
return TimeEntryActivity.shared.
|
||||
find(:all,
|
||||
:conditions => ["id NOT IN (?)", self.time_entry_activities.collect(&:parent_id)]) +
|
||||
self.time_entry_activities
|
||||
else
|
||||
return TimeEntryActivity.active.
|
||||
return TimeEntryActivity.shared.active.
|
||||
find(:all,
|
||||
:conditions => ["id NOT IN (?)", self.time_entry_activities.active.collect(&:parent_id)]) +
|
||||
self.time_entry_activities.active
|
||||
|
||||
Reference in new issue
Block a user