elabs/refile — pull request #82 by janko-m (2014-12-29 02:56:57+00:00)
Title: Make Refile::File wrapper for uploadable

Instead of extracting filename and content_type through the Refile constant, it feels much better to take an object oriented approach. Refile::File now wraps the uploadable from the outside world, and doesn't know anything about backends or IDs.

What I originally intended with this is that we can now, instead of handling content types and extensions in `Refile::Attacher`, just let users register their validators (and pass them though `:type` parameter), which would yield a `Refile::File` and then users can write their own validation (the same way that they register processors). Of course, Refile would still provide an `:image` validator. This way `Refile::File` would abstract the "uploadable".

I realized only before opening this PR that I broke the `#copy_to` in the S3 backend. Do you think this approach has potential to justify trying to fix the S3 in another way?