thoughtbot/paperclip — pull request #1148 by troelskn (2013-01-25 22:36:47+00:00)
Title: Add support for named option groups

To dry up models, I have made it possible to define named option groups. Usage would be to define these groups in an initializer (if using Rails) and then refer it from the models. E.g. instead of this:

```ruby
class Foo < ActiveRecord::Base
has_attached_file :image, {
:url => "/images/:class/:attachment/:id_partition/:style/:filename",
:path => ":rails_root/public:url",
:styles => {:medium => "300x300>", :thumb => "100x100>", :large => "600x600>"}
}
end
```

You would have:

```ruby
class Foo < ActiveRecord::Base
has_attached_file :image, :public_image
end
```

and then a definition in `config/initializers/paperclip.rb`:

```ruby
Paperclip::Attachment.options_for :public_image, {
:url => "/images/:class/:attachment/:id_partition/:style/:filename",
:path => ":rails_root/public:url",
:styles => {:medium => "300x300>", :thumb => "100x100>", :large => "600x600>"}
}
```