Sha256: e2c7aeb00fb1274f2acec70f2600615d475b883c882a052a2f7cd906c0a06bc5

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

class UserObserver < ActiveRecord::Observer
  
  def after_create(record)
    return if record.reset_token.nil?
    return unless ActionMailer::Base.perform_deliveries
    
    UserMailer.deliver_welcome_message(:to_email => record.email, 
                                      :to_name => record.full_name, 
                                      :token => record.reset_token)
  end
  
  def after_update(record)
    return if record.reset_token.nil?
    return unless ActionMailer::Base.perform_deliveries
    
    UserMailer.deliver_forgot_password(:to_email => record.email, 
                                      :to_name => record.full_name, 
                                      :token => record.reset_token)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rules_engine_users-0.0.3 rails_generators/templates/app/models/user_observer.rb
rules_engine_users-0.0.2 rails_generators/templates/app/models/user_observer.rb