On Jan 13, 5:28 pm, Jonathan Yurek <
jyu...@thoughtbot.com> wrote:
> There isn't anything like User.avatars this at the moment, but if you
> write up a patch with tests that sounds like something worth applying.
>
> Original isn't included in the style list because it's not technically
> a style. It should be if you actually put it into the styles
> definition (to modify it).
OK, I've got some commits that are ready to pull:
http://github.com/trevorturk/paperclip/commits/master
I made something that would define User#avatars via a new
User#attachments_for method. I'm not sure if you'll agree with the
placement of this or the tests, but I'm happy to move things around if
you like. I did my best to find the appropriate spots.
I included the "original" in the hash that's returned by User#avatars.
This just has the :url and :path for each file, which is all I need
for my purposes. We could make this more fancy if you like. This is
good enough for me, though, and I didn't want to get too
imaginative :)
A couple of small things: I wasn't able to get all the tests around
PDFs passing. Is there something I need to do for those? In any case,
I made sure all of the relevant stuff passed, so you should be fine.
Also, I wasn't sure where to add documentation, but I'm happy to put
something together if you'd like to point me in the right direction.
Thanks again for this plugin. It's been a pleasure to use.
- Trevor