1
0
mirror of https://github.com/krislamo/vagrant-easyredmine synced 2024-12-16 15:30:34 +00:00

add rake task to set some default redmine preferences

This commit is contained in:
Mark Heiges 2015-11-21 22:03:08 -05:00
parent 970c9aae47
commit 4becc1227b
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,38 @@
desc <<-END_DESC
Delete orphaned custom_values table rows from the database that once belonged to Projects that are now deleted. This
cleanup is needed before migrating to Easy Redmine.
Example:
rake redmine:ebrc_settings RAILS_ENV=production
END_DESC
namespace :redmine do
task :ebrc_settings => :environment do
Setting.ui_theme = '' # Default
EasySetting.where(:name => 'hide_login_quotes').each do |setting|
setting.value = true
setting.save
end
EasySetting.where(:name => 'show_easy_resource_booking').each do |setting|
setting.value = false
setting.save
end
EasySetting.where(:name => 'show_personal_statement').each do |setting|
setting.value = false
setting.save
end
EasySetting.where(:name => :attachment_description).each do |setting|
setting.value = true
setting.save
end
EasySetting.where(:name => :attachment_description_required).each do |setting|
setting.value = false
setting.save
end
end
end

View File

@ -59,3 +59,13 @@
sudo: no
environment:
PATH: "{{ ansible_env.PATH }}:~/bin"
- copy: dest='/opt/easyredmine/lib/tasks/ebrc_settings.rake'
src='ebrc_settings.rake'
sudo: yes
- name: Configuring Redmine with eupath preferences
command: 'rake redmine:ebrc_settings RAILS_ENV=production'
args:
chdir: '{{ redmine_root_dir }}'
sudo: no