You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

012_add_comments_permissions.rb 720B

1234567891011121314
  1. class AddCommentsPermissions < ActiveRecord::Migration[4.2]
  2. # model removed
  3. class Permission < ActiveRecord::Base; end
  4. def self.up
  5. Permission.create :controller => "news", :action => "add_comment", :description => "label_comment_add", :sort => 1130, :is_public => false, :mail_option => 0, :mail_enabled => 0
  6. Permission.create :controller => "news", :action => "destroy_comment", :description => "label_comment_delete", :sort => 1133, :is_public => false, :mail_option => 0, :mail_enabled => 0
  7. end
  8. def self.down
  9. Permission.where("controller=? and action=?", 'news', 'add_comment').first.destroy
  10. Permission.where("controller=? and action=?", 'news', 'destroy_comment').first.destroy
  11. end
  12. end