Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
New file uploads from web interface were failing due to the fact
Browse files Browse the repository at this point in the history
that the successes array doesn't contain an Asset but just a string
of the UUID.
  • Loading branch information
Tim Trautmann committed Sep 29, 2011
1 parent 6e2e14d commit 1871e20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/xml_controller.rb
Expand Up @@ -36,7 +36,10 @@ def index

successes, failures = counts
if successes.size == 1
flash.now[:message] = "asset <a href=\"#{asset_path(successes[0])}\">#{successes[0].title}</a> imported"
# Get the just uploaded asset and construct a success message with link
# to newly created record
asset = Asset.find_by_uuid(successes[0])
flash.now[:message] = "asset <a href=\"#{asset_path(asset)}\">#{asset.title}</a> imported"
else
flash.now[:message] = "#{successes.size} records imported"
end
Expand Down

0 comments on commit 1871e20

Please sign in to comment.