Class: People::EmailHash

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/people/email_hash.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.email_confirmObject



21
22
23
# File 'app/models/people/email_hash.rb', line 21

def self.email_confirm
	return 1
end

.expiration_minutesObject



29
30
31
# File 'app/models/people/email_hash.rb', line 29

def self.expiration_minutes
  return 360
end

.expired?(email_hash) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
39
40
41
# File 'app/models/people/email_hash.rb', line 33

def self.expired?(email_hash)
  date = email_hash.created_at.utc + ::People::EmailHash.expiration_minutes.minutes
  if ::Time.now.utc > date
    self.destroy
    return true
  else
    return false
  end
end

.forgotten_passwordObject



25
26
27
# File 'app/models/people/email_hash.rb', line 25

def self.forgotten_password
	return 2
end

Instance Method Details

#setup_email_hashObject



14
15
16
17
18
19
# File 'app/models/people/email_hash.rb', line 14

def setup_email_hash
   if self.token.nil? || self.token.blank?
	  self.token = ::Devise.friendly_token
   end
	return true
end