No commit activity in last 3 years
No release in over 3 years
This gem allows, for example, to have different stores configurations per environment
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Paperclip Environment Aware

This gem allows you to easily configure different stores in the different Rails environments for paperclip attachments. This is useful, for example, when you want to use S3 in production but not in development mode. You should be able to configure paperclip to use the file system storage in development and S3 in production. Also it’s usefull to have different buckets or paths for each environment.

Quick Start

Create config/paperclip_env.yml with your configurations (similar to database.yml)
Ej.

  # config/paperclip_env.yml
  ---
  production:
    storage: :s3
    s3_credentials:
      access_key_id: ASI3p24809we8409
      secret_access_key: V3Cxnx23yKuViGEzQPqrVVRwhUzSmTpD+wN/M0WL
    path: ":attachment/:id/:style/:basename.:extension"
    bucket: some_bucket
  class SomeModel < ActiveRecord::Base
    has_attached_file :main_photo
  end

With this configuration your non-production environments will store in your file system and your production environment will store in S3

TODO

Currently it’s not very flexible, but I’ll work to allow different configurations for differents models.