diff options
author | francis <francis> | 2008-10-02 23:11:39 +0000 |
---|---|---|
committer | francis <francis> | 2008-10-02 23:11:39 +0000 |
commit | 4f02cb989cd3eb0f01bd6dad1d13400f57c1e745 (patch) | |
tree | 166b72fd8ae0db426de8ae933483a405876427af /app/models/user.rb | |
parent | 1bf93279a8f9c3ac33b210a8d17a4a350ffa6c93 (diff) |
Option to hide comments.
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) |