summaryrefslogtreecommitdiffstats
path: root/db/migrate/018_set_doc_and_files_notifications.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-27 15:01:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-27 15:01:19 +0000
commit2d47a6d71c0973598bf2d59c59bd4050e77f3861 (patch)
treed5e119cf6d5be90d667c90c4fc81cdd76ceb8543 /db/migrate/018_set_doc_and_files_notifications.rb
parent22c2209cf9229e5f799a9612fadcb6119e412064 (diff)
downloadredmine-2d47a6d71c0973598bf2d59c59bd4050e77f3861.tar.gz
redmine-2d47a6d71c0973598bf2d59c59bd4050e77f3861.zip
mail notifications added when:
* a document is added * a file is added to the project * an attachment is added to an issue or a document git-svn-id: http://redmine.rubyforge.org/svn/trunk@196 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/018_set_doc_and_files_notifications.rb')
-rw-r--r--db/migrate/018_set_doc_and_files_notifications.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/018_set_doc_and_files_notifications.rb b/db/migrate/018_set_doc_and_files_notifications.rb
new file mode 100644
index 000000000..adbdd3b88
--- /dev/null
+++ b/db/migrate/018_set_doc_and_files_notifications.rb
@@ -0,0 +1,15 @@
+class SetDocAndFilesNotifications < ActiveRecord::Migration
+ def self.up
+ Permission.find_by_controller_and_action("projects", "add_file").update_attribute(:mail_option, true)
+ Permission.find_by_controller_and_action("projects", "add_document").update_attribute(:mail_option, true)
+ Permission.find_by_controller_and_action("documents", "add_attachment").update_attribute(:mail_option, true)
+ Permission.find_by_controller_and_action("issues", "add_attachment").update_attribute(:mail_option, true)
+ end
+
+ def self.down
+ Permission.find_by_controller_and_action("projects", "add_file").update_attribute(:mail_option, false)
+ Permission.find_by_controller_and_action("projects", "add_document").update_attribute(:mail_option, false)
+ Permission.find_by_controller_and_action("documents", "add_attachment").update_attribute(:mail_option, false)
+ Permission.find_by_controller_and_action("issues", "add_attachment").update_attribute(:mail_option, false)
+ end
+end