thoughtbot/paperclip — pull request #1233 by georgebrock (2013-05-09 21:40:15+00:00)
Title: Simplify `has_attached_file`

Once, long ago, @mike-burns and I were trying to fix a Paperclip bug. Along the way we got distracted by the amount of global state and extraneous methods that were added to ActiveRecord models. We started to refactor, and this is the result.

* All the logic of `has_attached_file` has been broken out into a `HasAttachedFile` class.
* Nothing gets added to `ActiveRecord::Base` except for the `has_attached_file` method.
* All the global state is now wrapped up in the `ActiveRecord::Registry` singleton object (which we'd prefer to have removed entirely, but it was required by the various rake tasks).