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-23 09:15:49 +0100 |
commit | ce72f203bbeb6ee5ae356f12b007b9631cf0dd7a (patch) | |
tree | 911efe64de32e4103cd4999d2f0c53cd0a8b6840 /app/models/incoming_message.rb | |
parent | 20b2a3c493d19b1ea66ba2605053af05f0595f7f (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/incoming_message.rb')
-rw-r--r-- | app/models/incoming_message.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 8de6e5ba8..9dcd8c1bc 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -674,7 +674,6 @@ class IncomingMessage < ActiveRecord::Base end end - # Fix DOS style linefeeds to Unix style ones (or other later regexps won't work) # Needed for e.g. http://www.whatdotheyknow.com/request/60/response/98 text = text.gsub(/\r\n/, "\n") @@ -1029,8 +1028,6 @@ class IncomingMessage < ActiveRecord::Base return get_body_for_quoting + "\n\n" + get_attachment_text_clipped end - - # Has message arrived "recently"? def recently_arrived (Time.now - self.created_at) <= 3.days @@ -1133,7 +1130,14 @@ class IncomingMessage < ActiveRecord::Base return content_type end - private :normalise_content_type + + def for_admin_column + self.class.content_columns.each do |column| + yield(column.human_name, self.send(column.name), column.type.to_s, column.name) + end + end + + private :normalise_content_type end |