summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-10-21 22:34:34 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-10-21 22:34:34 +0000
commit29301c8a381aa5995a0ce2e10ad91f210dc6464f (patch)
tree5d855e29cb37ca5e2dc28a76a9b1bd4c781cce08 /app
parente76d4c5c4c3f2beb8be1f441148e4627a14d37d1 (diff)
downloadredmine-29301c8a381aa5995a0ce2e10ad91f210dc6464f.tar.gz
redmine-29301c8a381aa5995a0ce2e10ad91f210dc6464f.zip
Added project specific Enumeration overrides.
These will be used to track if Enumeration's custom data or active state is overridden on a project. An overridden Enumeration is one that is associated with a parent Enumeration. #4077 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2947 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/enumeration.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index 436e82373..2d27d2f86 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -16,8 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Enumeration < ActiveRecord::Base
+ belongs_to :project
+
acts_as_list :scope => 'type = \'#{type}\''
acts_as_customizable
+ acts_as_tree :order => 'position ASC'
before_destroy :check_integrity
@@ -101,6 +104,11 @@ class Enumeration < ActiveRecord::Base
def in_use?
self.objects_count != 0
end
+
+ # Is this enumeration overiding a system level enumeration?
+ def is_override?
+ !self.parent.nil?
+ end
alias :destroy_without_reassign :destroy