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
ceab018b
Commit
ceab018b
authored
Dec 12, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not run post_processing if the attachment is not valid.
parent
17a03b28
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
lib/paperclip/attachment.rb
+1
-1
test/attachment_test.rb
+2
-0
test/integration_test.rb
+1
-1
No files found.
lib/paperclip/attachment.rb
View file @
ceab018b
...
...
@@ -83,7 +83,7 @@ module Paperclip
@dirty
=
true
post_process
post_process
if
valid?
# Reset the file size if the original file was reprocessed.
instance_write
(
:file_size
,
uploaded_file
.
size
.
to_i
)
...
...
test/attachment_test.rb
View file @
ceab018b
...
...
@@ -163,6 +163,7 @@ class AttachmentTest < Test::Unit::TestCase
@attachment
.
expects
(
:valid_assignment?
).
with
(
@not_file
).
returns
(
true
)
@attachment
.
expects
(
:queue_existing_for_delete
)
@attachment
.
expects
(
:post_process
)
@attachment
.
expects
(
:valid?
).
returns
(
true
)
@attachment
.
expects
(
:validate
)
@dummy
.
avatar
=
@not_file
end
...
...
@@ -192,6 +193,7 @@ class AttachmentTest < Test::Unit::TestCase
@attachment
.
expects
(
:valid_assignment?
).
with
(
@not_file
).
returns
(
true
)
@attachment
.
expects
(
:queue_existing_for_delete
)
@attachment
.
expects
(
:post_process
)
@attachment
.
expects
(
:valid?
).
returns
(
true
)
@attachment
.
expects
(
:validate
)
@dummy
.
avatar
=
@not_file
end
...
...
test/integration_test.rb
View file @
ceab018b
...
...
@@ -209,7 +209,7 @@ class IntegrationTest < Test::Unit::TestCase
@dummy
.
avatar
=
@bad_file
assert
!
@dummy
.
valid?
@dummy
.
avatar
=
nil
assert
@dummy
.
valid?
assert
@dummy
.
valid?
,
@dummy
.
errors
.
inspect
end
should
"know the difference between good files, bad files, not files, and nil when validating"
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