diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-11-12 15:06:46 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-11-12 15:06:46 +0000 |
commit | a1ca0f9123a3aea843ba35508a97d5a4fd5cb0db (patch) | |
tree | b9d3c1390f6b9c8b201e47507f26829b239f2773 /app/controllers/public_body_controller.rb | |
parent | 8271b2c664f04d1b68a8b4d4fdb801f5c6b00b8c (diff) | |
parent | c96b27c301023a6a1f50c12f0c387205b0255836 (diff) |
Merge remote-tracking branch 'origin/release/0.6.8'0.6.8
Conflicts:
locale/cs/app.po
locale/sl/app.po
locale/sq/app.po
locale/tr/app.po
locale/uk/app.po
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index b34e89b8d..8a4a65820 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -146,38 +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', - '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.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 |