Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
0109948a
Commit
0109948a
authored
Dec 13, 2013
by
Henry Turner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document :s3_credentials being able to take a Proc
parent
6459f2c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
lib/paperclip/storage/s3.rb
+13
-1
No files found.
lib/paperclip/storage/s3.rb
View file @
0109948a
...
@@ -6,7 +6,7 @@ module Paperclip
...
@@ -6,7 +6,7 @@ module Paperclip
# To use Paperclip with S3, include the +aws-sdk+ gem in your Gemfile:
# To use Paperclip with S3, include the +aws-sdk+ gem in your Gemfile:
# gem 'aws-sdk'
# gem 'aws-sdk'
# There are a few S3-specific options for has_attached_file:
# There are a few S3-specific options for has_attached_file:
# * +s3_credentials+: Takes a path, a File,
or a Hash
. The path (or File) must point
# * +s3_credentials+: Takes a path, a File,
a Hash or a Proc
. The path (or File) must point
# to a YAML file containing the +access_key_id+ and +secret_access_key+ that Amazon
# to a YAML file containing the +access_key_id+ and +secret_access_key+ that Amazon
# gives you. You can 'environment-space' this just like you do to your
# gives you. You can 'environment-space' this just like you do to your
# database.yml file, so different environments can use different accounts:
# database.yml file, so different environments can use different accounts:
...
@@ -26,6 +26,18 @@ module Paperclip
...
@@ -26,6 +26,18 @@ module Paperclip
# put your bucket name in this file, instead of adding it to the code directly.
# put your bucket name in this file, instead of adding it to the code directly.
# This is useful when you want the same account but a different bucket for
# This is useful when you want the same account but a different bucket for
# development versus production.
# development versus production.
# When using a Proc it provides a single parameter which is the attachment itself. A
# method #instance is available on the attachment which will take you back to your
# code. eg.
# class User
# has_attached_file :download,
# :storage => :s3,
# :s3_credentials => Proc.new{|a| a.instance.s3_credentials }
#
# def s3_credentials
# {:bucket => "xxx", :access_key_id => "xxx", :secret_access_key => "xxx"}
# end
# end
# * +s3_permissions+: This is a String that should be one of the "canned" access
# * +s3_permissions+: This is a String that should be one of the "canned" access
# policies that S3 provides (more information can be found here:
# policies that S3 provides (more information can be found here:
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAccessPolicy.html)
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAccessPolicy.html)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment