aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-03-09 11:48:38 +0000
committerSeb Bacon <seb.bacon@gmail.com>2012-03-13 13:55:47 +0000
commit76de470b1424be57934e58275a6116afb8eb9b3c (patch)
tree6ed9df78a8acac8278776c831ae6eb08383d935c /app/models/user.rb
parent17373088052029db46f6f8a6243901e442f6015c (diff)
first stab at sending PURGE requests to upstream varnish for request pages. Next step: making it asynchronous, e.g. with a queue of things to purge via a cron job.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 59a84b7aa..73d65a8ca 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -422,5 +422,12 @@ class User < ActiveRecord::Base
end
return true
end
+
+ 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}
+ end
+
end