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
dca87ec5
Commit
dca87ec5
authored
Jul 07, 2014
by
Jonathan Lim
Committed by
Jon Yurek
Jul 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow #original_filename= to receive nil argument
parent
ad23a0f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
lib/paperclip/io_adapters/abstract_adapter.rb
+1
-0
spec/paperclip/io_adapters/abstract_adapter_spec.rb
+7
-0
No files found.
lib/paperclip/io_adapters/abstract_adapter.rb
View file @
dca87ec5
...
...
@@ -20,6 +20,7 @@ module Paperclip
end
def
original_filename
=
(
new_filename
)
return
unless
new_filename
@original_filename
=
new_filename
.
gsub
(
OS_RESTRICTED_CHARACTERS
,
"_"
)
end
...
...
spec/paperclip/io_adapters/abstract_adapter_spec.rb
View file @
dca87ec5
...
...
@@ -67,4 +67,11 @@ describe Paperclip::AbstractAdapter do
@adapter
.
original_filename
=
"file.png"
expect
(
@adapter
.
send
(
:destination
).
path
).
to
end_with
(
".png"
)
end
context
"#original_filename="
do
it
"should not fail with a nil original filename"
do
adapter
=
TestAdapter
.
new
expect
{
adapter
.
original_filename
=
nil
}.
not_to
raise_error
end
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