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:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user