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
978b1e98
Commit
978b1e98
authored
Aug 13, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed error in S3 deleting
parent
f4a11e1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
lib/paperclip/storage.rb
+1
-1
test/storage_test.rb
+17
-0
No files found.
lib/paperclip/storage.rb
View file @
978b1e98
...
@@ -158,7 +158,7 @@ module Paperclip
...
@@ -158,7 +158,7 @@ module Paperclip
logger
.
info
(
"[paperclip] Writing files for
#{
name
}
"
)
logger
.
info
(
"[paperclip] Writing files for
#{
name
}
"
)
@queued_for_delete
.
each
do
|
path
|
@queued_for_delete
.
each
do
|
path
|
begin
begin
logger
.
info
(
"[paperclip] ->
#{
path
(
style
)
}
"
)
logger
.
info
(
"[paperclip] ->
#{
path
}
"
)
if
file
=
s3_bucket
.
key
(
path
)
if
file
=
s3_bucket
.
key
(
path
)
file
.
delete
file
.
delete
end
end
...
...
test/storage_test.rb
View file @
978b1e98
...
@@ -91,6 +91,23 @@ class StorageTest < Test::Unit::TestCase
...
@@ -91,6 +91,23 @@ class StorageTest < Test::Unit::TestCase
assert
true
assert
true
end
end
end
end
context
"and remove"
do
setup
do
@s3_mock
=
stub
@bucket_mock
=
stub
RightAws
::
S3
.
expects
(
:new
).
with
(
"12345"
,
"54321"
,
{}).
returns
(
@s3_mock
)
@s3_mock
.
expects
(
:bucket
).
with
(
"testing"
,
true
,
"public-read"
).
returns
(
@bucket_mock
)
@key_mock
=
stub
@bucket_mock
.
expects
(
:key
).
at_least
(
2
).
returns
(
@key_mock
)
@key_mock
.
expects
(
:delete
)
@dummy
.
destroy_attached_files
end
should
"succeed"
do
assert
true
end
end
end
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