mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 18:36:26 +02:00
Fixed that validating a Setting with invalid name triggers an error (#15551).
git-svn-id: http://svn.redmine.org/redmine/trunk@12348 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -83,7 +83,9 @@ class Setting < ActiveRecord::Base
|
||||
|
||||
validates_uniqueness_of :name
|
||||
validates_inclusion_of :name, :in => @@available_settings.keys
|
||||
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting| @@available_settings[setting.name]['format'] == 'int' }
|
||||
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting|
|
||||
(s = @@available_settings[setting.name]) && s['format'] == 'int'
|
||||
}
|
||||
|
||||
# Hash used to cache setting values
|
||||
@cached_settings = {}
|
||||
|
||||
Reference in New Issue
Block a user