Modified: trunk/app/controllers/workflows_controller.rb (2566 => 2567)
--- trunk/app/controllers/workflows_controller.rb 2011-03-01 17:22:04 UTC (rev 2566)
+++ trunk/app/controllers/workflows_controller.rb 2011-03-02 13:38:16 UTC (rev 2567)
@@ -170,7 +170,7 @@
def galaxy_tool_download
if params[:server].nil? || params[:server].empty?
- flash.now[:error] = "You must provide a URL to a Taverna server."
+ flash.now[:error] = "You must provide the URL to a Taverna server."
render(:action ="" :galaxy_tool, :id => @workflow.id, :version => @viewing_version_number.to_s)
return
end
@@ -182,6 +182,12 @@
zip_file = File.read(zip_file_name)
File.unlink(zip_file_name)
+ Download.create(:contribution => @workflow.contribution,
+ :user => (logged_in? ? current_user : nil),
+ :user_agent => request.env['HTTP_USER_AGENT'],
+ :accessed_from_site => accessed_from_website?(),
+ :kind => 'Galaxy tool')
+
send_data(zip_file,
:filename => "address@hidden",
:type => 'application/zip',
Modified: trunk/config/base_schema.xml (2566 => 2567)
--- trunk/config/base_schema.xml 2011-03-01 17:22:04 UTC (rev 2566)
+++ trunk/config/base_schema.xml 2011-03-02 13:38:16 UTC (rev 2567)
@@ -32,6 +32,21 @@
</table>
+ <table name="downloads">
+
+ <column type="integer" name="contribution_id"/>
+ <column type="integer" name="user_id"/>
+ <column type="datetime" name="created_at"/>
+ <column type="string" name="user_agent"/>
+ <column type="boolean" name="accessed_from_site" default="0"/>
+ <column type="string" name="kind"/>
+
+ <index>
+ <column name="contribution_id"/>
+ </index>
+
+ </table>
+
<table name="content_types">
<column type="integer" name="user_id"/>