Mercurial > hg > soundsoftware-site
view plugins/redmine_checkout/db/migrate/20100203202320_update_settings.rb @ 1559:21098b932cb8 feature_1136
Separate out git repo dir and work dir (so as to serve repo dir only)
author | Chris Cannam |
---|---|
date | Thu, 14 Jan 2016 10:27:25 +0000 |
parents | b4b72f1eb644 |
children |
line wrap: on
line source
class UpdateSettings < ActiveRecord::Migration def self.up settings = Setting.plugin_redmine_checkout if settings['checkout_url_type'] == "overwritten" settings['checkout_url_type'] = "generated" end if settings.has_key? "checkout_url_regex" settings['checkout_url_regex_default'] = settings.delete("checkout_url_regex") end if settings.has_key? "checkout_url_regex_replacement" settings['checkout_url_regex_replacement_default'] = settings.delete("checkout_url_regex_replacement") end Setting.plugin_redmine_checkout = settings end def self.down settings = Setting.plugin_redmine_checkout if settings['checkout_url_type'] == "generated" settings['checkout_url_type'] = "overwritten" end if settings.has_key? "checkout_url_regex_default" settings['checkout_url_regex'] = settings.delete("checkout_url_regex_default") end if settings.has_key? "checkout_url_regex_replacement_default" settings['checkout_url_regex_replacement'] = settings.delete("checkout_url_regex_replacement_default") end Setting.plugin_redmine_checkout = settings end end