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
9050ecd5
Commit
9050ecd5
authored
Jun 30, 2011
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the attachment's timestamp if the original file got reprocessed
Closes #170
parent
e2add646
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
lib/paperclip/attachment.rb
+1
-0
test/integration_test.rb
+5
-0
No files found.
lib/paperclip/attachment.rb
View file @
9050ecd5
...
@@ -263,6 +263,7 @@ module Paperclip
...
@@ -263,6 +263,7 @@ module Paperclip
new_original
.
rewind
new_original
.
rewind
@queued_for_write
=
{
:original
=>
new_original
}
@queued_for_write
=
{
:original
=>
new_original
}
instance_write
(
:updated_at
,
Time
.
now
)
post_process
(
*
style_args
)
post_process
(
*
style_args
)
old_original
.
close
if
old_original
.
respond_to?
(
:close
)
old_original
.
close
if
old_original
.
respond_to?
(
:close
)
...
...
test/integration_test.rb
View file @
9050ecd5
...
@@ -58,6 +58,7 @@ class IntegrationTest < Test::Unit::TestCase
...
@@ -58,6 +58,7 @@ class IntegrationTest < Test::Unit::TestCase
has_attached_file
:avatar
,
:styles
=>
{
:thumb
=>
"150x25#"
,
:dynamic
=>
lambda
{
|
a
|
'50x50#'
}
}
has_attached_file
:avatar
,
:styles
=>
{
:thumb
=>
"150x25#"
,
:dynamic
=>
lambda
{
|
a
|
'50x50#'
}
}
end
end
@d2
=
Dummy
.
find
(
@dummy
.
id
)
@d2
=
Dummy
.
find
(
@dummy
.
id
)
@original_timestamp
=
@d2
.
avatar_updated_at
@d2
.
avatar
.
reprocess!
@d2
.
avatar
.
reprocess!
@d2
.
save
@d2
.
save
end
end
...
@@ -66,6 +67,10 @@ class IntegrationTest < Test::Unit::TestCase
...
@@ -66,6 +67,10 @@ class IntegrationTest < Test::Unit::TestCase
assert_match
/\b150x25\b/
,
`identify "
#{
@dummy
.
avatar
.
path
(
:thumb
)
}
"`
assert_match
/\b150x25\b/
,
`identify "
#{
@dummy
.
avatar
.
path
(
:thumb
)
}
"`
assert_match
/\b50x50\b/
,
`identify "
#{
@dummy
.
avatar
.
path
(
:dynamic
)
}
"`
assert_match
/\b50x50\b/
,
`identify "
#{
@dummy
.
avatar
.
path
(
:dynamic
)
}
"`
end
end
should
"change the timestamp"
do
assert_not_equal
@original_timestamp
,
@d2
.
avatar_updated_at
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