technoweenie / restful-authentication

Generates common user authentication code for Rails/Merb, with a full test/unit and rspec suite and optional Acts as State Machine support built-in.

This URL has Read+Write access

restful-authentication / generators / authenticated / templates / observer.rb
100644 12 lines (10 sloc) 0.377 kb
1
2
3
4
5
6
7
8
9
10
11
12
class <%= class_name %>Observer < ActiveRecord::Observer
def after_create(<%= file_name %>)
<%= class_name %>Mailer.deliver_signup_notification(<%= file_name %>)
end
 
def after_save(<%= file_name %>)
<% if options[:include_activation] %>
<%= class_name %>Mailer.deliver_activation(<%= file_name %>) if <%= file_name %>.recently_activated?
<% end %>
  end
end