Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to Have Different Buckets for Different Models? #20

Open
rdetert opened this issue Nov 17, 2015 · 2 comments
Open

Possible to Have Different Buckets for Different Models? #20

rdetert opened this issue Nov 17, 2015 · 2 comments

Comments

@rdetert
Copy link

rdetert commented Nov 17, 2015

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?

@markevans
Copy link
Owner

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?

@michaelkeenan
Copy link

michaelkeenan commented Sep 21, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants