2007-01-27 18:01:19 +03:00
|
|
|
class SetDocAndFilesNotifications < ActiveRecord::Migration
|
2007-08-29 20:52:35 +04:00
|
|
|
# model removed
|
|
|
|
class Permission < ActiveRecord::Base; end
|
|
|
|
|
2007-01-27 18:01:19 +03:00
|
|
|
def self.up
|
2013-12-20 11:10:46 +04:00
|
|
|
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)}
|
2007-01-27 18:01:19 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2013-12-20 11:10:46 +04:00
|
|
|
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)}
|
2007-01-27 18:01:19 +03:00
|
|
|
end
|
|
|
|
end
|