download complete submission as one zip file

This commit is contained in:
Ralf Teusner
2016-07-15 18:25:58 +02:00
parent 41370a8703
commit 09533a5556
8 changed files with 31 additions and 7 deletions

View File

@ -28,13 +28,17 @@ class Submission < ActiveRecord::Base
ancestors.merge(descendants).values
end
[:download, :render, :run, :test].each do |action|
[:download_file, :render, :run, :test].each do |action|
filename = FILENAME_URL_PLACEHOLDER.gsub(/\W/, '')
define_method("#{action}_url") do
Rails.application.routes.url_helpers.send(:"#{action}_submission_path", self, filename).sub(filename, FILENAME_URL_PLACEHOLDER)
end
end
def download_url
Rails.application.routes.url_helpers.send(:download_submission_path, self)
end
def main_file
collect_files.detect(&:main_file?)
end