diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-23 01:53:38 -0700 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-23 01:53:38 -0700 |
commit | 8300398b9f4666c102d6c205f1b94e00b8017014 (patch) | |
tree | bfecc1ae98ff202e4063714c267afde0692f1ca7 /app/models/user.rb | |
parent | 20b2a3c493d19b1ea66ba2605053af05f0595f7f (diff) | |
parent | 820e124c20865c17eeea2e17c5bb82da620ada5b (diff) |
Merge pull request #493 from sebbacon/feature/merge-wombleton-sparkly-admin-css
Merge @wombleton sparkly admin css
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 - |