Modified: branches/datasets/app/models/pack.rb (2856 => 2857)
--- branches/datasets/app/models/pack.rb 2011-12-01 13:31:55 UTC (rev 2856)
+++ branches/datasets/app/models/pack.rb 2011-12-01 13:48:30 UTC (rev 2857)
@@ -150,9 +150,9 @@
if item_type != "Pack" && Authorization.is_authorized?('download', nil, item, user)
stats[:downloaded][item_type] ||= []
stats[:downloaded][item_type] << entry
- zip_filenames << item_filename(item)
- #zipfile.add_data("#{item_type.underscore.pluralize}/#{item_filename(item)}", item_data(item, user))
- zipfile.get_output_stream("#{item_type.model_alias.underscore.pluralize}/#{item_filename(item)}") { |stream| stream.write(item_data(item, user))}
+ filename = item_filename(item)
+ zip_filenames << filename
+ zipfile.get_output_stream("#{item_type.model_alias.underscore.pluralize}/#{filename}") { |stream| stream.write(item_data(item, user))}
elsif Authorization.is_authorized?('view', nil, item, user)
stats[:view_only][item_type] ||= []
stats[:view_only][item_type] << entry
@@ -181,7 +181,7 @@
# remove any temporary files that were created while creating the zip file
# (these are created in the same place, where the zip file is stored)
zip_filenames.each do |temp_file|
- FileUtils.rm Dir.glob(Pack.archive_folder + "/" + "#{temp_file}.*"), :force => true # 'force' option makes sure that exceptions are never raised
+ FileUtils.rm Dir.glob(Pack.archive_folder + "/" + "#{temp_file}*"), :force => true # 'force' option makes sure that exceptions are never raised
end