Sha256: 80e286d20a16d203caeb98de427857f02582abbd5cd5c0c8f0561473c47bcc58

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

class UserObserver < ActiveRecord::Observer
  
  def after_create(record)
    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

1 entries across 1 versions & 1 rubygems

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