018_set_doc_and_files_notifications.rb
18 lines
| 1.1 KiB
| text/x-ruby
|
RubyLexer
|
r193 | class SetDocAndFilesNotifications < ActiveRecord::Migration | ||
|
r663 | # model removed | ||
class Permission < ActiveRecord::Base; end | ||||
|
r193 | def self.up | ||
|
r12147 | 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)} | ||||
|
r193 | end | ||
def self.down | ||||
|
r12147 | 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)} | ||||
|
r193 | end | ||
end | ||||