Commit ee3ac2ce9555bb33e1d71ae9c30547cbdfb153a9

Authored by Antonio Terceiro
1 parent a289c353

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.
app/models/email_activation.rb
... ... @@ -17,6 +17,10 @@ class EmailActivation < Task
17 17  
18 18 def perform
19 19 person.user.enable_email!
  20 + end
  21 +
  22 + # :nodoc:
  23 + def after_finish
20 24 User::Mailer.deliver_activation_email_notify(person.user)
21 25 end
22 26  
... ...
app/models/task.rb
... ... @@ -80,6 +80,11 @@ class Task < ActiveRecord::Base
80 80 RAILS_DEFAULT_LOGGER.info ex.to_s
81 81 end
82 82 end
  83 + after_finish
  84 + end
  85 +
  86 + # :nodoc:
  87 + def after_finish
83 88 end
84 89  
85 90 # this method cancels the task. At the end a message (as returned by
... ...