Removes column opt in enumerations table.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3240 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-25 17:13:58 +00:00
parent 9fb40b1a2f
commit 8db9ecef08
9 changed files with 23 additions and 67 deletions
-2
View File
@@ -19,8 +19,6 @@ class DocumentCategory < Enumeration
has_many :documents, :foreign_key => 'category_id'
OptionName = :enumeration_doc_categories
# Backwards compatiblity. Can be removed post-0.9
OptName = 'DCAT'
def option_name
OptionName
-36
View File
@@ -29,36 +29,6 @@ class Enumeration < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:type, :project_id]
validates_length_of :name, :maximum => 30
# Backwards compatiblity named_scopes.
# Can be removed post-0.9
named_scope :priorities, :conditions => { :type => "IssuePriority" }, :order => 'position' do
ActiveSupport::Deprecation.warn("Enumeration#priorities is deprecated, use the IssuePriority class. (#{Redmine::Info.issue(3007)})")
def default
find(:first, :conditions => { :is_default => true })
end
end
named_scope :document_categories, :conditions => { :type => "DocumentCategory" }, :order => 'position' do
ActiveSupport::Deprecation.warn("Enumeration#document_categories is deprecated, use the DocumentCategories class. (#{Redmine::Info.issue(3007)})")
def default
find(:first, :conditions => { :is_default => true })
end
end
named_scope :activities, :conditions => { :type => "TimeEntryActivity" }, :order => 'position' do
ActiveSupport::Deprecation.warn("Enumeration#activities is deprecated, use the TimeEntryActivity class. (#{Redmine::Info.issue(3007)})")
def default
find(:first, :conditions => { :is_default => true })
end
end
named_scope :values, lambda {|type| { :conditions => { :type => type }, :order => 'position' } } do
def default
find(:first, :conditions => { :is_default => true })
end
end
# End backwards compatiblity named_scopes
named_scope :shared, :conditions => { :project_id => nil }
named_scope :active, :conditions => { :active => true }
@@ -80,12 +50,6 @@ class Enumeration < ActiveRecord::Base
nil
end
# Backwards compatiblity. Can be removed post-0.9
def opt
ActiveSupport::Deprecation.warn("Enumeration#opt is deprecated, use the STI classes now. (#{Redmine::Info.issue(3007)})")
return OptName
end
def before_save
if is_default? && is_default_changed?
Enumeration.update_all("is_default = #{connection.quoted_false}", {:type => type})
-2
View File
@@ -19,8 +19,6 @@ class IssuePriority < Enumeration
has_many :issues, :foreign_key => 'priority_id'
OptionName = :enumeration_issue_priorities
# Backwards compatiblity. Can be removed post-0.9
OptName = 'IPRI'
def option_name
OptionName
-2
View File
@@ -19,8 +19,6 @@ class TimeEntryActivity < Enumeration
has_many :time_entries, :foreign_key => 'activity_id'
OptionName = :enumeration_activities
# Backwards compatiblity. Can be removed post-0.9
OptName = 'ACTI'
def option_name
OptionName