diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index ba7e6f72b..072cca50a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user.rb,v 1.72 2008-09-24 12:59:27 francis Exp $ +# $Id: user.rb,v 1.73 2008-10-02 23:11:40 francis Exp $ require 'digest/sha1' @@ -68,6 +68,10 @@ class User < ActiveRecord::Base end end + def visible_comments + self.comments.find(:all, :conditions => 'visible') + end + def validate errors.add(:email, "doesn't look like a valid address") unless MySociety::Validate.is_valid_email(self.email) if MySociety::Validate.is_valid_email(self.name) |