include Redmine::SubclassFactory
has_many :enumerations,
- lambda { order(:position) },
+ lambda {order(:position)},
:class_name => 'CustomFieldEnumeration',
:dependent => :delete_all
has_many :custom_values, :dependent => :delete_all
validates_uniqueness_of :name, :scope => :type
validates_length_of :name, :maximum => 30
validates_length_of :regexp, maximum: 255
- validates_inclusion_of :field_format, :in => Proc.new { Redmine::FieldFormat.available_formats }
+ validates_inclusion_of :field_format, :in => Proc.new {Redmine::FieldFormat.available_formats}
validate :validate_custom_field
before_validation :set_searchable
end
end
- scope :sorted, lambda { order(:position) }
+ scope :sorted, lambda {order(:position)}
scope :visible, lambda {|*args|
user = args.shift || User.current
if user.admin?