dragonfly-s3_data_store icon indicating copy to clipboard operation
dragonfly-s3_data_store copied to clipboard

Possible to Have Different Buckets for Different Models?

Open rdetert opened this issue 9 years ago • 2 comments

I have all my image uploads going to s3.mydomain.com but for an attachment feature I'd like them to go in their own bucket attachments.mydomain.com

Is it possible to have different configurations for different models?

rdetert avatar Nov 17 '15 23:11 rdetert

not currently, but you can assign e.g. model accessors to different dragonfly apps, each which have a differently configured s3 data store (as per http://markevans.github.io/dragonfly/models first couple of paragraphs). Does that suit the use case?

markevans avatar Nov 18 '15 15:11 markevans

For anyone coming across this, as I did: this approach works, but it's easy to miss that you'll need to have a middleware line once for each bucket/app, as described here. For example:

Rails.application.middleware.use Dragonfly::Middleware
Rails.application.middleware.use Dragonfly::Middleware, :attachments

michaelkeenan avatar Sep 21 '18 18:09 michaelkeenan