1
0
miroir de https://github.com/redmine/redmine.git synchronisé 2024-07-27 07:37:45 +02:00
redmine/db/migrate/018_set_doc_and_files_notifications.rb

19 lignes
1.2 KiB
Ruby

class SetDocAndFilesNotifications < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
def self.up
Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, true)}
Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, true)}
Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)}
Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)}
end
def self.down
Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, false)}
Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, false)}
Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)}
Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)}
end
end