aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-06-23 09:33:42 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-23 09:33:42 +0100
commitdb1a388f0a7b37cc0ceb3ca07b995b34dabdba58 (patch)
treee34df5ae0dacdbf6c3b77542b22f2d9e3799d322 /app/models/user.rb
parenta7cc84b9b2b430644fe23e6328d7ab289e7abf0a (diff)
parent7d0fea4b38c214a67b2fc4b56aa670e02a3cda61 (diff)
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop
Conflicts: Gemfile.lock script/handle-mail-replies script/handle-mail-replies.rb spec/controllers/request_controller_spec.rb
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 57fce429c..a21676f68 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -409,7 +409,7 @@ class User < ActiveRecord::Base
columns = self.class.content_columns.map{|c| c if %w(created_at updated_at admin_level email_confirmed).include?(c.name) }.compact
end
columns.each do |column|
- yield(column.human_name, self.send(column.name), column.type.to_s)
+ yield(column.human_name, self.send(column.name), column.type.to_s, column.name)
end
end
@@ -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