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
9ec35a6d
Commit
9ec35a6d
authored
Feb 24, 2011
by
John Hawthorn
Committed by
Jon Yurek
Mar 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
performance: only define s3 interpolations once.
parent
317c04bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lib/paperclip/storage/s3.rb
+3
-3
No files found.
lib/paperclip/storage/s3.rb
View file @
9ec35a6d
...
...
@@ -85,13 +85,13 @@ module Paperclip
end
Paperclip
.
interpolates
(
:s3_alias_url
)
do
|
attachment
,
style
|
"
#{
attachment
.
s3_protocol
}
://
#{
attachment
.
s3_host_alias
}
/
#{
attachment
.
path
(
style
).
gsub
(
%r{^/}
,
""
)
}
"
end
end
unless
Paperclip
::
Interpolations
.
respond_to?
:s3_alias_url
Paperclip
.
interpolates
(
:s3_path_url
)
do
|
attachment
,
style
|
"
#{
attachment
.
s3_protocol
}
://s3.amazonaws.com/
#{
attachment
.
bucket_name
}
/
#{
attachment
.
path
(
style
).
gsub
(
%r{^/}
,
""
)
}
"
end
end
unless
Paperclip
::
Interpolations
.
respond_to?
:s3_path_url
Paperclip
.
interpolates
(
:s3_domain_url
)
do
|
attachment
,
style
|
"
#{
attachment
.
s3_protocol
}
://
#{
attachment
.
bucket_name
}
.s3.amazonaws.com/
#{
attachment
.
path
(
style
).
gsub
(
%r{^/}
,
""
)
}
"
end
end
unless
Paperclip
::
Interpolations
.
respond_to?
:s3_domain_url
end
def
expiring_url
(
time
=
3600
)
...
...
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