views:

28

answers:

2

I have a rails app that I'm going to host on engineyard and want to store image files on s3.

But I don't know if I want all developer machines to beusing s3 for storage of all our test and dev images. Maybe it's not an issue -- but it seems like a waste to have everyone storing all our images in s3.

I've heard of some ppl who store images on s3 'hacking' dev environments to store images locally on the file system -- and then using s3 in prod only.

What are other people doing?

+1  A: 

You could write a wrapper class around the gem that uses the file system for image storage instead of S3 for non-production environments. Then your application would use the wrapper rather than the gem directly. Or make the image store the wrapper uses a configuration option.

John Topley
But in general, you support having the storage choice be dependent upon the RAILS_ENV?The gem supports local and S3 storage -- I'd modify my model class to specify one or the other depending upon RAILS_ENV.
Kevin Bedell
Sure, it sounds reasonable. There seems little sense in having the development environment hitting S3 all the time. I think you'd want the QA environment to use S3 though because QA should mirror production. Note that `Rails.env` is now the preferred way to obtain the Rails environment programmatically, rather than `RAILS_ENV`.
John Topley
A: 

I use why's old Camping app, parkplace. It behaves like (most?) of the S3 API, but runs locally. The new location for it is here: http://github.com/technoweenie/parkplace

jdl