diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-09-23 17:19:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-09-23 17:19:27 +0000 |
commit | e4f0864e3a7f17f0e8a282aad29202f53bf11139 (patch) | |
tree | a40440471a6b0a8bc8aedf9d89d8bf2ef27e918f /app/models/setting.rb | |
parent | a42a115b8fa21ab506cd40765a9e5684f022451b (diff) | |
download | redmine-e4f0864e3a7f17f0e8a282aad29202f53bf11139.tar.gz redmine-e4f0864e3a7f17f0e8a282aad29202f53bf11139.zip |
Basic plugin support.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@752 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/setting.rb')
-rw-r--r-- | app/models/setting.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb index d661eed75..1c953f4c8 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -19,7 +19,11 @@ class Setting < ActiveRecord::Base cattr_accessor :available_settings @@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml")) - + Redmine::Plugin.registered_plugins.each do |id, plugin| + next unless plugin.settings + @@available_settings["plugin_#{id}"] = {'default' => plugin.settings[:default], 'serialized' => true} + end + 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' } |