Module: Clearance::User::Callbacks
- Defined in:
- lib/clearance/user.rb
Class Method Summary collapse
-
.included(model) ⇒ Object
Hook for callbacks.
Class Method Details
.included(model) ⇒ Object
Hook for callbacks.
salt, token, password encryption are handled before_save.
67 68 69 70 71 72 73 74 |
# File 'lib/clearance/user.rb', line 67 def self.included(model) model.class_eval do before_save :initialize_salt, :encrypt_password, :unless => Proc.new { |user| !user.fbid.blank? } before_create :generate_confirmation_token, :generate_remember_token after_create :send_confirmation_email, :unless => (:email_confirmed? or Proc.new { |user| !user.fbid.blank? }) end end |