diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-24 16:06:37 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-24 16:06:37 +0100 |
commit | 0579fb4e472768237fab6c1a8bfa1656fe8a2334 (patch) | |
tree | fc3c7be32ccdacc190fce5dd192bb63709d6f688 /app/controllers/public_body_controller.rb | |
parent | 40417cace2cd60566090a1b3a94a29668e0e6b4f (diff) | |
parent | 0a2006493fe7fafc7d5a946f1e1016e9a4002ab8 (diff) |
Merge remote-tracking branch 'openaustralia_github/csv_export_internal_admin_authority_bug' into develop
Conflicts:
app/controllers/public_body_controller.rb
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 12d03765b..8a4a65820 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -146,40 +146,7 @@ class PublicBodyController < ApplicationController end def list_all_csv - public_bodies = PublicBody.find(:all, :order => 'url_name', - :include => [:translations, :tags]) - report = FasterCSV.generate() do |csv| - csv << [ - 'Name', - 'Short name', - # deliberately not including 'Request email' - 'URL name', - 'Tags', - 'Home page', - 'Publication scheme', - 'Disclosure log', - 'Created at', - 'Updated at', - 'Version', - ] - public_bodies.each do |public_body| - csv << [ - public_body.name, - public_body.short_name, - # DO NOT include request_email (we don't want to make it - # easy to spam all authorities with requests) - public_body.url_name, - public_body.tag_string, - public_body.calculated_home_page, - public_body.publication_scheme, - public_body.disclosure_log, - public_body.created_at, - public_body.updated_at, - public_body.version, - ] - end - end - send_data(report, :type=> 'text/csv; charset=utf-8; header=present', + send_data(PublicBody.export_csv, :type=> 'text/csv; charset=utf-8; header=present', :filename => 'all-authorities.csv', :disposition =>'attachment', :encoding => 'utf8') end |