006_calendar_and_activity.rb 957 Bytes
Newer Older
jplang's avatar
jplang committed
1
class CalendarAndActivity < ActiveRecord::Migration[4.2]
jplang's avatar
jplang committed
2 3 4
  # model removed
  class Permission < ActiveRecord::Base; end

jplang's avatar
jplang committed
5 6 7 8 9 10 11
  def self.up
    Permission.create :controller => "projects", :action => "activity", :description => "label_activity", :sort => 160, :is_public => true, :mail_option => 0, :mail_enabled => 0
    Permission.create :controller => "projects", :action => "calendar", :description => "label_calendar", :sort => 165, :is_public => true, :mail_option => 0, :mail_enabled => 0
    Permission.create :controller => "projects", :action => "gantt", :description => "label_gantt", :sort => 166, :is_public => true, :mail_option => 0, :mail_enabled => 0
  end

  def self.down
12 13 14
    Permission.where("controller=? and action=?", 'projects', 'activity').first.destroy
    Permission.where("controller=? and action=?", 'projects', 'calendar').first.destroy
    Permission.where("controller=? and action=?", 'projects', 'gantt').first.destroy
jplang's avatar
jplang committed
15 16
  end
end