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.

018_set_doc_and_files_notifications.rb 1.0KB

123456789101112131415161718
  1. class SetDocAndFilesNotifications < ActiveRecord::Migration
  2. # model removed
  3. class Permission < ActiveRecord::Base; end
  4. def self.up
  5. Permission.find_by_controller_and_action("projects", "add_file").update_attribute(:mail_option, true)
  6. Permission.find_by_controller_and_action("projects", "add_document").update_attribute(:mail_option, true)
  7. Permission.find_by_controller_and_action("documents", "add_attachment").update_attribute(:mail_option, true)
  8. Permission.find_by_controller_and_action("issues", "add_attachment").update_attribute(:mail_option, true)
  9. end
  10. def self.down
  11. Permission.find_by_controller_and_action("projects", "add_file").update_attribute(:mail_option, false)
  12. Permission.find_by_controller_and_action("projects", "add_document").update_attribute(:mail_option, false)
  13. Permission.find_by_controller_and_action("documents", "add_attachment").update_attribute(:mail_option, false)
  14. Permission.find_by_controller_and_action("issues", "add_attachment").update_attribute(:mail_option, false)
  15. end
  16. end