Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Customer < ActiveRecord::Base
- after_create :send_welcome_email, unless: :auto_registered?
- has_one :auto_created, dependent: :destroy
- private
- def send_welcome_email
- CustomerMailer.welcome_email(self).deliver
- end
- def auto_registered?
- !auto_created.nil?
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement