diff .svn/pristine/52/52e141046a10068211408d55ec6484cccb3d452a.svn-base @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents 622f24f53b42
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.svn/pristine/52/52e141046a10068211408d55ec6484cccb3d452a.svn-base	Fri Jun 14 09:28:30 2013 +0100
@@ -0,0 +1,18 @@
+class CreateEnabledModules < ActiveRecord::Migration
+  def self.up
+    create_table :enabled_modules do |t|
+      t.column :project_id, :integer
+      t.column :name, :string, :null => false
+    end
+    add_index :enabled_modules, [:project_id], :name => :enabled_modules_project_id
+
+    # Enable all modules for existing projects
+    Project.all.each do |project|
+      project.enabled_module_names = Redmine::AccessControl.available_project_modules
+    end
+  end
+
+  def self.down
+    drop_table :enabled_modules
+  end
+end