a TON of bugfixes and new features
This commit is contained in:
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
|
||||
|
||||
has_secure_password
|
||||
|
||||
before_validation :strip_whitespaces, :set_uuid, :set_name, :set_role, :set_email_token
|
||||
before_validation :strip_whitespaces, :set_uuid, :set_name, :set_email_token
|
||||
|
||||
validates_presence_of :password, :password_confirmation, :email_token, :on => :create
|
||||
validates_presence_of :name, :email, :ign
|
||||
@@ -38,6 +38,10 @@ class User < ActiveRecord::Base
|
||||
!!self.confirmed
|
||||
end
|
||||
|
||||
def online?
|
||||
last_seen && last_seen > 5.minutes.ago
|
||||
end
|
||||
|
||||
#roles
|
||||
def disabled?
|
||||
!!(self.role == :disabled)
|
||||
@@ -179,10 +183,6 @@ class User < ActiveRecord::Base
|
||||
self.name ||= self.ign
|
||||
end
|
||||
|
||||
def set_role
|
||||
self.role ||= Role.get(:normal)
|
||||
end
|
||||
|
||||
def account_exists?
|
||||
profile = self.get_profile
|
||||
if !profile || profile["demo"] == true
|
||||
|
||||
Reference in New Issue
Block a user