Class: User

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

Instance Method Summary collapse

Instance Method Details

#deliver_password_reset_instructions!Object



26
27
28
29
# File 'app/models/user.rb', line 26

def deliver_password_reset_instructions!
  reset_perishable_token!
  UserMailer.deliver_password_reset_instructions(self)
end

#has_role?(role_in_question) ⇒ Boolean

has_role? simply needs to return true or false whether a user has a role or not.

Returns:

  • (Boolean)


32
33
34
35
# File 'app/models/user.rb', line 32

def has_role?(role_in_question)
  @_list ||= self.roles.collect(&:name)
  (@_list.include?(role_in_question.to_s) )
end