Rails3: model: replace deprecated before_validation method at CustomField model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8191 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4f8ed70813
commit
f1994ea9c0
|
@ -28,13 +28,14 @@ class CustomField < ActiveRecord::Base
|
|||
validates_inclusion_of :field_format, :in => Redmine::CustomFieldFormat.available_formats
|
||||
|
||||
validate :validate_values
|
||||
before_validation :set_searchable
|
||||
|
||||
def initialize(attributes = nil)
|
||||
super
|
||||
self.possible_values ||= []
|
||||
end
|
||||
|
||||
def before_validation
|
||||
def set_searchable
|
||||
# make sure these fields are not searchable
|
||||
self.searchable = false if %w(int float date bool).include?(field_format)
|
||||
true
|
||||
|
|
Loading…
Reference in New Issue