To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb @ 1298:4f746d8966dd
History | View | Annotate | Download (419 Bytes)
| 1 | 14:1d32c0a0efbf | Chris | class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration |
|---|---|---|---|
| 2 | def self.up |
||
| 3 | 1295:622f24f53b42 | Chris | EnabledModule.where(:name => 'issue_tracking').all.each do |e| |
| 4 | 14:1d32c0a0efbf | Chris | EnabledModule.create(:name => 'calendar', :project_id => e.project_id) |
| 5 | EnabledModule.create(:name => 'gantt', :project_id => e.project_id) |
||
| 6 | end
|
||
| 7 | end
|
||
| 8 | |||
| 9 | def self.down |
||
| 10 | EnabledModule.delete_all("name = 'calendar' OR name = 'gantt'") |
||
| 11 | end
|
||
| 12 | end |