summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 52e20dd..d44df40 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -6,6 +6,8 @@ class User < CouchRest::Model::Base
property :login, String, :accessible => true
property :password_verifier, String, :accessible => true
property :password_salt, String, :accessible => true
+ property :contact_email, String, :accessible => true
+ property :contact_email_key, String, :accessible => true
property :enabled, TrueClass, :default => true
@@ -33,6 +35,10 @@ class User < CouchRest::Model::Base
:confirmation => true,
:format => { :with => /.{8}.*/, :message => "needs to be at least 8 characters long" }
+ validates :contact_email, :allow_blank => true,
+ :email => true,
+ :mx_with_fallback => true
+
timestamps!
design do
@@ -90,6 +96,10 @@ class User < CouchRest::Model::Base
APP_CONFIG['admins'].include? self.login
end
+ def is_anonymous?
+ false
+ end
+
def most_recent_tickets(count=3)
Ticket.for_user(self).limit(count).all #defaults to having most recent updated first
end