Skip to content

Instantly share code, notes, and snippets.

@vividtone
Created March 1, 2012 06:56
Show Gist options
  • Save vividtone/1947912 to your computer and use it in GitHub Desktop.
Save vividtone/1947912 to your computer and use it in GitHub Desktop.
Redmineの添付ファイル付きチケットの一覧をCSV形式で表示
# encoding: utf-8
#
# Redmineの添付ファイル付きのチケットの一覧をCSV形式で表示。
#
# [実行方法]
# ruby script/runner -e production issues_with_attachments.rb
issues_attachments = Attachment.all.select {|item| item.container_type == 'Issue'}
issues_attachments.each do |item|
issue = Issue.find(item.container_id)
project_name = issue.project.name
puts %Q|"#{project_name}",#{item.container_id},"#{item.filename}",#{item.filesize}|
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment