diff options
author | elijah <elijah@riseup.net> | 2015-04-30 00:32:33 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-04-30 00:32:33 -0700 |
commit | 63871baf6061668b162972193c55b5a8f7490797 (patch) | |
tree | ca8cd5fbab18cbe59b728a123f450140ed98f519 /app/models/user.rb | |
parent | c3b133cb6f02003ab934e5008e108f489ace4158 (diff) |
added support for email notifications of ticket changes
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 10 |
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 |