Class: MmUser

Inherits:
Object
  • Object
show all
Includes:
MongoMapper::Document
Defined in:
lib/models/mongomapper_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)



35
36
37
# File 'lib/models/mongomapper_user.rb', line 35

def method_missing(m, *args)
  return false
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



15
16
17
# File 'lib/models/mongomapper_user.rb', line 15

def password
  @password
end

#password_confirmationObject

Returns the value of attribute password_confirmation.



15
16
17
# File 'lib/models/mongomapper_user.rb', line 15

def password_confirmation
  @password_confirmation
end

Instance Method Details

#admin?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/models/mongomapper_user.rb', line 25

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

#site_admin?Boolean

Returns:

  • (Boolean)


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

def site_admin?
  self.id == 1
end