##// END OF EJS Templates
Allow key authentication when deleting issues (with tests) #6447...
Allow key authentication when deleting issues (with tests) #6447 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4367 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r4132:d2986eb98fa4
r4253:c55e060bab62
Show More
20100129193813_update_mail_notification_values.rb
25 lines | 869 B | text/x-ruby | RubyLexer
/ db / migrate / 20100129193813_update_mail_notification_values.rb
# Patch the data from a boolean change.
class UpdateMailNotificationValues < ActiveRecord::Migration
def self.up
User.record_timestamps = false
User.all.each do |u|
u.mail_notification = if u.mail_notification =~ /\A(1|t)\z/
# User set for all email (t is for sqlite)
'all'
else
# User wants to recieve notifications on specific projects?
if u.memberships.count(:conditions => {:mail_notification => true}) > 0
'selected'
else
'only_my_events'
end
end
u.save!
end
User.record_timestamps = true
end
def self.down
# No-op
end
end