Can't download issue's attachments
Created by: nbigaouette
I'm having a problem when trying to download an attachment from an issue.
I get a 500 error from the server, and the following in production.log:
Started GET "/assets/korolev-medium-compressed-5e301975ed1e50b1c558e2fcab9badbf.otf" for 127.0.0.1 at 2013-01-18 13:46:19 -0500
Served asset /korolev-medium-compressed-5e301975ed1e50b1c558e2fcab9badbf.otf - 200 OK (0ms)
Started GET "/assets/fontawesome-webfont-8255009c90d86ee3458a13f5db9a6ed0.woff" for 127.0.0.1 at 2013-01-18 13:46:19 -0500
Served asset /fontawesome-webfont-8255009c90d86ee3458a13f5db9a6ed0.woff - 200 OK (0ms)
Started GET "/assets/icon-attachment.png" for 127.0.0.1 at 2013-01-18 13:46:19 -0500
Served asset /icon-attachment.png - 200 OK (0ms)
Started GET "/uploads/note/attachment/6/figure.png" for 127.0.0.1 at 2013-01-18 13:46:20 -0500
Processing by ProjectsController#show as HTML
Parameters: {"id"=>"uploads/note/attachment/6/figure.png"}
Completed 500 Internal Server Error in 2ms
NoMethodError (undefined method `id' for nil:NilClass):
app/models/project.rb:104:in `find_with_namespace'
app/controllers/application_controller.rb:69:in `project'
Started GET "/static.css" for 127.0.0.1 at 2013-01-18 13:46:20 -0500
Processing by ProjectsController#show as HTML
Parameters: {"id"=>"static.css"}
Rendered public/404.html (0.0ms)
Filter chain halted as :project rendered or redirected
Completed 404 Not Found in 2ms (Views: 0.6ms | ActiveRecord: 0.4ms)
Started GET "/favicon.ico" for 127.0.0.1 at 2013-01-18 13:46:20 -0500
Processing by ProjectsController#show as */*
Parameters: {"id"=>"favicon.ico"}
Rendered public/404.html (0.0ms)
Filter chain halted as :project rendered or redirected
Completed 404 Not Found in 2ms (Views: 0.3ms | ActiveRecord: 0.7ms)
Looks similar to issue #2365 (closed).
I'm using commit 042a561b from the 4-0-stable branch on ArchLinux x86_64.
Thanks