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
94eb2916
Commit
94eb2916
authored
Nov 05, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting and anchoring the extension gsub to the end
parent
7d29d06d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
2 deletions
+1
-2
lib/paperclip/attachment.rb
+1
-1
test/attachment_test.rb
+0
-1
No files found.
lib/paperclip/attachment.rb
View file @
94eb2916
...
@@ -169,7 +169,7 @@ module Paperclip
...
@@ -169,7 +169,7 @@ module Paperclip
attachment
.
instance
.
class
.
name
.
underscore
.
pluralize
attachment
.
instance
.
class
.
name
.
underscore
.
pluralize
end
,
end
,
:basename
=>
lambda
do
|
attachment
,
style
|
:basename
=>
lambda
do
|
attachment
,
style
|
attachment
.
original_filename
.
gsub
(
File
.
extname
(
attachment
.
original_filename
)
,
""
)
attachment
.
original_filename
.
gsub
(
/
#{
File
.
extname
(
attachment
.
original_filename
)
}
$/
,
""
)
end
,
end
,
:extension
=>
lambda
do
|
attachment
,
style
|
:extension
=>
lambda
do
|
attachment
,
style
|
((
style
=
attachment
.
styles
[
style
])
&&
style
.
last
)
||
((
style
=
attachment
.
styles
[
style
])
&&
style
.
last
)
||
...
...
test/attachment_test.rb
View file @
94eb2916
...
@@ -174,7 +174,6 @@ class AttachmentTest < Test::Unit::TestCase
...
@@ -174,7 +174,6 @@ class AttachmentTest < Test::Unit::TestCase
should
"strip whitespace from content_type field"
do
should
"strip whitespace from content_type field"
do
assert_equal
"image/png"
,
@dummy
.
avatar
.
instance
.
avatar_content_type
assert_equal
"image/png"
,
@dummy
.
avatar
.
instance
.
avatar_content_type
end
end
end
end
context
"Attachment with strange letters"
do
context
"Attachment with strange letters"
do
...
...
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