Skip to content

Instantly share code, notes, and snippets.

@faizaankhan
Last active June 19, 2018 14:13
Show Gist options
  • Save faizaankhan/04eccc0763d87ac3da1a9e7ced66b874 to your computer and use it in GitHub Desktop.
Save faizaankhan/04eccc0763d87ac3da1a9e7ced66b874 to your computer and use it in GitHub Desktop.
if paperclip_cfg = YAML.load_file("#{Rails.root}/config/paperclip.yml")[Rails.env]
paperclip_cfg.symbolize_keys!
Paperclip::Attachment.default_options.merge!(paperclip_cfg)
end
common: &local_settings
path: ":class/:id_partition/:hash.:extension"
hash_secret: "31f20b780e1e9dec2643bde2fca542ad2ba5140502ce091b364fd35f07168b38829aaeffe3ccfb853ce69f580480323cdf103a18ee092a0be1ec16abb425054b"
convert_options: {
all: "-interlace Plane -strip"
}
development:
<<: *local_settings
storage: :filesystem
test:
<<: *local_settings
storage: :filesystem
aws_config: &aws_config
bucket: Rails.application.secrets.bucket
access_key_id: Rails.application.secrets.aws_access_key_id
secret_access_key: Rails.application.secrets.aws_access_key_secret
production:
<<: *local_settings
storage: :s3
s3_credentials: *aws_config
s3_permissions: :private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment