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
8edccdce
Commit
8edccdce
authored
Mar 12, 2012
by
Mathieu Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure Paperclip doesn't raise an exception when using a numeric style name
parent
f6e01b6b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
lib/paperclip/interpolations.rb
+1
-1
lib/paperclip/storage/s3.rb
+1
-1
No files found.
lib/paperclip/interpolations.rb
View file @
8edccdce
...
@@ -93,7 +93,7 @@ module Paperclip
...
@@ -93,7 +93,7 @@ module Paperclip
# If the style has a format defined, it will return the format instead
# If the style has a format defined, it will return the format instead
# of the actual extension.
# of the actual extension.
def
extension
attachment
,
style_name
def
extension
attachment
,
style_name
((
style
=
attachment
.
styles
[
style_name
.
to_sym
])
&&
style
[
:format
])
||
((
style
=
attachment
.
styles
[
style_name
.
to_s
.
to_s
ym
])
&&
style
[
:format
])
||
File
.
extname
(
attachment
.
original_filename
).
gsub
(
/^\.+/
,
""
)
File
.
extname
(
attachment
.
original_filename
).
gsub
(
/^\.+/
,
""
)
end
end
...
...
lib/paperclip/storage/s3.rb
View file @
8edccdce
...
@@ -95,7 +95,7 @@ module Paperclip
...
@@ -95,7 +95,7 @@ module Paperclip
@s3_permissions
=
set_permissions
(
@options
[
:s3_permissions
])
@s3_permissions
=
set_permissions
(
@options
[
:s3_permissions
])
@s3_protocol
=
@options
[
:s3_protocol
]
||
@s3_protocol
=
@options
[
:s3_protocol
]
||
Proc
.
new
do
|
style
,
attachment
|
Proc
.
new
do
|
style
,
attachment
|
permission
=
(
@s3_permissions
[
style
.
to_sym
]
||
@s3_permissions
[
:default
])
permission
=
(
@s3_permissions
[
style
.
to_s
.
to_s
ym
]
||
@s3_permissions
[
:default
])
permission
=
permission
.
call
(
attachment
,
style
)
if
permission
.
is_a?
(
Proc
)
permission
=
permission
.
call
(
attachment
,
style
)
if
permission
.
is_a?
(
Proc
)
(
permission
==
:public_read
)
?
'http'
:
'https'
(
permission
==
:public_read
)
?
'http'
:
'https'
end
end
...
...
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