module Devise::Models::Pinfirmable

Public Instance Methods

confirm() click to toggle source
# File lib/pinfirmable/models/pinfirmable.rb, line 11
def confirm
  update_attribute(:pinfirmable_pin, nil)
end
skip_pinfirmation!() click to toggle source
# File lib/pinfirmable/models/pinfirmable.rb, line 15
def skip_pinfirmation!
  @skip_pinfirmation = true
end

Protected Instance Methods

generate_confirmation_token() click to toggle source
# File lib/pinfirmable/models/pinfirmable.rb, line 21
def generate_confirmation_token
  pin = ""
  6.times { pin << SecureRandom.random_number(9).to_s }
  self.pinfirmable_pin = pin
end
send_confirmation_instructions() click to toggle source
# File lib/pinfirmable/models/pinfirmable.rb, line 27
def send_confirmation_instructions
  PinfirmableMailer.pin_email(self).deliver unless @skip_pinfirmation
end

Private Instance Methods

skip_pinfirmation?() click to toggle source
# File lib/pinfirmable/models/pinfirmable.rb, line 33
def skip_pinfirmation?
  !!@skip_pinfirmation
end