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
e5ed0191
Commit
e5ed0191
authored
Jun 15, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also make sure that file is rewinded in filestore
parent
95d7c4a1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
lib/paperclip/storage/filesystem.rb
+1
-0
test/storage/filesystem_test.rb
+6
-0
No files found.
lib/paperclip/storage/filesystem.rb
View file @
e5ed0191
...
@@ -36,6 +36,7 @@ module Paperclip
...
@@ -36,6 +36,7 @@ module Paperclip
end
end
end
end
FileUtils
.
chmod
(
0666
&~
File
.
umask
,
path
(
style_name
))
FileUtils
.
chmod
(
0666
&~
File
.
umask
,
path
(
style_name
))
file
.
rewind
end
end
after_flush_writes
# allows attachment to clean up temp files
after_flush_writes
# allows attachment to clean up temp files
...
...
test/storage/filesystem_test.rb
View file @
e5ed0191
...
@@ -26,6 +26,12 @@ class FileSystemTest < Test::Unit::TestCase
...
@@ -26,6 +26,12 @@ class FileSystemTest < Test::Unit::TestCase
@dummy
.
save
@dummy
.
save
assert_file_exists
(
@dummy
.
avatar
.
path
(
:thumbnail
))
assert_file_exists
(
@dummy
.
avatar
.
path
(
:thumbnail
))
end
end
should
"be rewinded after flush_writes"
do
files
=
@dummy
.
avatar
.
queued_for_write
.
map
{
|
style
,
file
|
file
}
@dummy
.
save
assert
files
.
none?
(
&
:eof?
),
"Expect all the files to be rewinded."
end
end
end
context
"with file that has space in file name"
do
context
"with file that has space in file name"
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