Sha256: 957ccca46ba2a676a7cc07a13be245f44e6a80ef0bf44cd4f82be55cec99c076
Contents?: true
Size: 807 Bytes
Versions: 16
Compression:
Stored size: 807 Bytes
Contents
module Pageflow # Specialized User class containing invitation logic used by in the # users admin. class InvitedUser < User before_create :prepare_invitation after_create :send_invitation def send_invitation! prepare_invitation save(validate: false) send_invitation end private def prepare_invitation @token = generate_reset_password_token end def generate_reset_password_token raw, enc = Devise.token_generator.generate(self.class, :reset_password_token) self.reset_password_token = enc self.reset_password_sent_at = Time.now.utc raw end def password_required? false end def send_invitation UserMailer.invitation('user_id' => id, 'password_token' => @token).deliver end end end
Version data entries
16 entries across 16 versions & 1 rubygems