title: When I have the backing data already, how do I get PaperClip to generate a file URL without instantiating the entire object?
body: <p>I've run into a situation where, for performance reasons, I want / need to use a view to load data instead of fetching a root object, then related objects in an N+1 query.  Instead of repeating that query everywhere, I want to code it in a view (using scenic-views) so I can re-use the basic logic -- instead of copying the entire query then modifying raw SQL, I can use the view and then standard active record query methods.</p>
  
  <p>Unfortunately, part of the data I need to serialize in my response is generated by PaperClip, and I'm not sure how to work around this.</p>
  
  <p>My user model has a photo, stored via PaperClip.  When serializing my data, I can serialize this as easily as <code>user.photo? ? user.photo.url : nil</code>.  Unfortunately, since I'm not instantiating a user class, while I have all the <em>components</em> of the resulting url (my view fetches the entire user table, and adds extra data) I'm not sure how I can put them together to generate the <em>actual</em> URL.  I don't want to call the database again to instantiate a user object, but I don't think I can instantiate the user object with the existing column data.</p>
  
  <p>I feel like I'm probably missing something insanely obvious in here, some way to instantiate the user object using the fetched column data, just not seeing it.</p>