diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-02-06 15:14:01 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-02-06 15:14:01 +0000 |
commit | 0f541e0cf80ba1135a2ae0ae34d53c7917dec23c (patch) | |
tree | d1337eacccad398ea4c41d3709515152eaf637cf /app/models/user.rb | |
parent | 3b6e5a692b852a88f55b21a7210f60a6f7cfc24b (diff) |
Don’t index unconfirmed users
Closes #415.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 691a59e48..59a84b7aa 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -61,7 +61,8 @@ class User < ActiveRecord::Base :values => [ [ :created_at_numeric, 1, "created_at", :number ] # for sorting ], - :terms => [ [ :variety, 'V', "variety" ] ] + :terms => [ [ :variety, 'V', "variety" ] ], + :if => :indexed_by_search? def created_at_numeric # format it here as no datetime support in Xapian's value ranges return self.created_at.strftime("%Y%m%d%H%M%S") @@ -394,6 +395,10 @@ class User < ActiveRecord::Base def should_be_emailed? return (self.email_confirmed && self.email_bounced_at.nil?) end + + def indexed_by_search? + return self.email_confirmed + end ## Private instance methods private |