Created
March 1, 2012 06:56
-
-
Save vividtone/1947912 to your computer and use it in GitHub Desktop.
Redmineの添付ファイル付きチケットの一覧をCSV形式で表示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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