File: 20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb

package info (click to toggle)
redmine 6.0.6%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,104 kB
  • sloc: ruby: 116,318; javascript: 12,885; sh: 460; perl: 303; python: 166; makefile: 30
file content (12 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration[4.2]
  def self.up
    EnabledModule.where(:name => 'issue_tracking').each do |e|
      EnabledModule.create(:name => 'calendar', :project_id => e.project_id)
      EnabledModule.create(:name => 'gantt', :project_id => e.project_id)
    end
  end

  def self.down
    EnabledModule.where("name = 'calendar' OR name = 'gantt'").delete_all
  end
end