Default values for settings not appearing on an existing site - am I doing anything wrong?
Added by Enrique Garcia over 2 years ago
Hello there,
I've nearly finished a plugin that allows 'filtering' on the projects/index view, via text and also custom fields.
The admin can decide what custom fields are used as filters on the plugin configuration page, and he's also able to add custom CSS rules that appear on projects/.
I thought - well, let's configure those as settings!
Here's the init.rb part that initializes the settings:
Redmine::Plugin.register :redmine_project_filtering do
# ...
settings({
:partial => 'settings/redmine_project_filtering',
:default => {
'used_fields' => {},
'css' => "
#project_filtering label { display: block; }
... (some more css rules here)
"
}
})
end
My problem is: when I install this plugin on my testing environment (script/plugin install my-git-address, the plugin doesn't have any plugin migrations), if I go to the plugin settings, they are blank (they are also blank on the db, although I expected that, kindof)
Must I do anything else in order to have the settings default to what is written above when they are installed on an existing site, or do they just meant to be used when I do rake redmine:load_default_data?