From 12792d8068d0ed0514e89267edefaab4df5cf2c3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 17 Jan 2009 11:18:04 +0000 Subject: User custom fields can now be set as editable so that users can edit them on 'My account'. For existing user custom fields, this new attribute is set to false by default to preserve the prior behaviour (it can turned on by editing the custom field in admin area). Note: on the registration form, *required* custom fields will be displayed even if they are not defined as editable so that the account can be created. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2276 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- db/migrate/102_add_custom_fields_editable.rb | 9 +++++++++ db/migrate/103_set_custom_fields_editable.rb | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 db/migrate/102_add_custom_fields_editable.rb create mode 100644 db/migrate/103_set_custom_fields_editable.rb (limited to 'db/migrate') diff --git a/db/migrate/102_add_custom_fields_editable.rb b/db/migrate/102_add_custom_fields_editable.rb new file mode 100644 index 000000000..949f9db9d --- /dev/null +++ b/db/migrate/102_add_custom_fields_editable.rb @@ -0,0 +1,9 @@ +class AddCustomFieldsEditable < ActiveRecord::Migration + def self.up + add_column :custom_fields, :editable, :boolean, :default => true + end + + def self.down + remove_column :custom_fields, :editable + end +end diff --git a/db/migrate/103_set_custom_fields_editable.rb b/db/migrate/103_set_custom_fields_editable.rb new file mode 100644 index 000000000..465c929ec --- /dev/null +++ b/db/migrate/103_set_custom_fields_editable.rb @@ -0,0 +1,9 @@ +class SetCustomFieldsEditable < ActiveRecord::Migration + def self.up + UserCustomField.update_all('editable = false') + end + + def self.down + UserCustomField.update_all('editable = true') + end +end -- cgit v1.2.3