diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-11 12:04:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-11 12:04:54 +0000 |
commit | f1994ea9c0820fa3efdb55dde62efd107a3f2fb6 (patch) | |
tree | fef91b8b3d67a9dd39550ea6efa1656deb511f58 /app | |
parent | 4f8ed70813772a803948a156381e8f71cd1bd3af (diff) | |
download | redmine-f1994ea9c0820fa3efdb55dde62efd107a3f2fb6.tar.gz redmine-f1994ea9c0820fa3efdb55dde62efd107a3f2fb6.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/custom_field.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 7202076e8..09cb03471 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -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 |