aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:11:03 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-20 10:11:03 +0100
commit08dac0261325cd757b7146f9626f3c7b48cc672c (patch)
treebbb87c1728e552335107e573ecddcb97328b335d /app/models/user.rb
parent9f578d781b7e575d89432facccfc5b41b4664297 (diff)
Only invalidate a user's cached requests when their *name* changes. Otherwise we issue PURGEs every time, for example, we send out email alerts.
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 573649b8f..a21676f68 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -438,8 +438,9 @@ class User < ActiveRecord::Base
after_save(:purge_in_cache)
def purge_in_cache
- # XXX should only be if specific attributes have changed
- self.info_requests.each {|x| x.purge_in_cache}
+ if self.name_changed?
+ self.info_requests.each {|x| x.purge_in_cache}
+ end
end
end