Class: MongoidUser

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/models/mongoid_user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object (protected)



39
40
41
# File 'lib/models/mongoid_user.rb', line 39

def method_missing(m, *args)
  return false
end

Instance Attribute Details

#passwordObject

attr_protected :_id, :salt



21
22
23
# File 'lib/models/mongoid_user.rb', line 21

def password
  @password
end

#password_confirmationObject

attr_protected :_id, :salt



21
22
23
# File 'lib/models/mongoid_user.rb', line 21

def password_confirmation
  @password_confirmation
end

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/models/mongoid_user.rb', line 29

def admin?
  self.permission_level == -1 || self.id == 1
end

#site_admin?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/models/mongoid_user.rb', line 33

def site_admin?
  self.id == 1
end