diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-15 11:04:50 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-15 11:04:50 +0100 |
commit | f9fc1fd6509bc89394ff0735ab4efc46492f7bd3 (patch) | |
tree | 86d7ec44d64aa65ccdb101b2a7a2b2f5c1d0f6e8 /app/models/user.rb | |
parent | 95e7cd60a2ff78aa8550dc1855ee7c01a0f4c6f2 (diff) |
Merge from wombleton:feature/440_sparkly_admin_css
Includes a couple of additional fixes:
* Remember to HTML-quote things that could come from users
* Fix form post action for editing users
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index cd8d3e721..4a7153b3f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -400,6 +400,17 @@ class User < ActiveRecord::Base return self.email_confirmed end + def for_admin_column(complete = false) + if complete + columns = self.class.content_columns + else + 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) + end + end + ## Private instance methods private @@ -430,4 +441,3 @@ class User < ActiveRecord::Base end end - |