aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorlouise <louise>2009-04-09 12:22:46 +0000
committerlouise <louise>2009-04-09 12:22:46 +0000
commit522bc953d180fe405b2b53674dbb5d38d081ebe8 (patch)
tree719c6a15ff68fc911f3334b5372a448ac5ef9f52 /app/models/user.rb
parent4f7668980d16b55a2719be2cff83114e408d1d89 (diff)
Adding a flag to allow user model to be saved without reindexing associated models
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 4638583e2..f7c77af56 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -23,7 +23,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.88 2009-04-08 07:31:07 francis Exp $
+# $Id: user.rb,v 1.89 2009-04-09 12:22:46 louise Exp $
require 'digest/sha1'
@@ -43,7 +43,7 @@ class User < ActiveRecord::Base
has_many :track_things, :foreign_key => 'tracking_user_id', :order => 'created_at desc'
has_many :comments, :order => 'created_at desc'
- attr_accessor :password_confirmation
+ attr_accessor :password_confirmation, :no_reindex
validates_confirmation_of :password, :message =>"^Please enter the same password twice"
validates_inclusion_of :admin_level, :in => [
@@ -74,6 +74,7 @@ class User < ActiveRecord::Base
# requested_by: and commented_by: search queries also need updating after save
after_save :reindex_referencing_models
def reindex_referencing_models
+ return if no_reindex == true
for comment in self.comments
for info_request_event in comment.info_request_events
info_request_event.xapian_mark_needs_index