thoughtbot/paperclip — Issue #685: Paperclip::Interpolations#id produces nil
Author: mike-burns
Created: 2011-12-16 20:13:01+00:00
State: open

The `Paperclip::Interpolations#id` method produces `nil` when the underlying ActiveRecord object has no ID.

Rather than worry about `NoMethodError`s down the road, let's have it produce something sensible. What should the URL be when one of the components of it is the empty string? We want to handle both:

/files/:id/:style.png

and:

/files/somestuff:id/:style.png

If you accidentally refactor Paperclip::Interpolations to be a class that doesn't do magical things with method names then I won't mind. I swear.