Commit ee3ac2ce9555bb33e1d71ae9c30547cbdfb153a9
1 parent
a289c353
Exists in
master
and in
28 other branches
ActionItem1219: now actually sending the e-mail
Send the e-mail outside the Task transaction, so the e-mail server can have an up-to-date view of the table.
Showing
2 changed files
with
9 additions
and
0 deletions
Show diff stats
app/models/email_activation.rb
@@ -17,6 +17,10 @@ class EmailActivation < Task | @@ -17,6 +17,10 @@ class EmailActivation < Task | ||
17 | 17 | ||
18 | def perform | 18 | def perform |
19 | person.user.enable_email! | 19 | person.user.enable_email! |
20 | + end | ||
21 | + | ||
22 | + # :nodoc: | ||
23 | + def after_finish | ||
20 | User::Mailer.deliver_activation_email_notify(person.user) | 24 | User::Mailer.deliver_activation_email_notify(person.user) |
21 | end | 25 | end |
22 | 26 |
app/models/task.rb
@@ -80,6 +80,11 @@ class Task < ActiveRecord::Base | @@ -80,6 +80,11 @@ class Task < ActiveRecord::Base | ||
80 | RAILS_DEFAULT_LOGGER.info ex.to_s | 80 | RAILS_DEFAULT_LOGGER.info ex.to_s |
81 | end | 81 | end |
82 | end | 82 | end |
83 | + after_finish | ||
84 | + end | ||
85 | + | ||
86 | + # :nodoc: | ||
87 | + def after_finish | ||
83 | end | 88 | end |
84 | 89 | ||
85 | # this method cancels the task. At the end a message (as returned by | 90 | # this method cancels the task. At the end a message (as returned by |