aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-09-08 00:39:13 +0100
committerRobin Houston <robin@lenny.robin>2011-09-08 00:39:13 +0100
commit55ab78f81b66edbf34c806df48677a1156c499d8 (patch)
treef1f180f90e7fdb8b745f0514a5b71273270e26fa /app/models/user.rb
parente00da51de4d0909a48b2569f1c66c0655f7bc63d (diff)
Fix User.should_be_emailed?
The User.should_be_emailed? method needs to be public. It should also be tested.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index aee701031..5dbd4b98e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -349,21 +349,23 @@ class User < ActiveRecord::Base
self.save!
end
+ def should_be_emailed?
+ return (self.email_confirmed && self.email_bounced_at.nil?)
+ end
+
+ ## Private instance methods
private
- def User.encrypted_password(password, salt)
- string_to_hash = password + salt # XXX need to add a secret here too?
- Digest::SHA1.hexdigest(string_to_hash)
- end
-
def create_new_salt
self.salt = self.object_id.to_s + rand.to_s
end
- def should_be_emailed?
- return (self.email_confirmed && self.email_bounced_at.nil?)
+ ## Class methods
+ def User.encrypted_password(password, salt)
+ string_to_hash = password + salt # XXX need to add a secret here too?
+ Digest::SHA1.hexdigest(string_to_hash)
end
-
+
def User.record_bounce_for_email(email, message)
user = User.find_user_by_email(email)
return false if user.nil?