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
a9553332
Commit
a9553332
authored
Aug 06, 2012
by
Michael Reinsch
Committed by
Jon Yurek
Aug 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print errors right away, don't let the user wait
parent
cb7ad7bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lib/tasks/paperclip.rake
+3
-3
No files found.
lib/tasks/paperclip.rake
View file @
a9553332
...
@@ -26,17 +26,17 @@ namespace :paperclip do
...
@@ -26,17 +26,17 @@ namespace :paperclip do
namespace
:refresh
do
namespace
:refresh
do
desc
"Regenerates thumbnails for a given CLASS (and optional ATTACHMENT and STYLES splitted by comma)."
desc
"Regenerates thumbnails for a given CLASS (and optional ATTACHMENT and STYLES splitted by comma)."
task
:thumbnails
=>
:environment
do
task
:thumbnails
=>
:environment
do
errors
=
[]
klass
=
Paperclip
::
Task
.
obtain_class
klass
=
Paperclip
::
Task
.
obtain_class
names
=
Paperclip
::
Task
.
obtain_attachments
(
klass
)
names
=
Paperclip
::
Task
.
obtain_attachments
(
klass
)
styles
=
(
ENV
[
'STYLES'
]
||
ENV
[
'styles'
]
||
''
).
split
(
','
).
map
(
&
:to_sym
)
styles
=
(
ENV
[
'STYLES'
]
||
ENV
[
'styles'
]
||
''
).
split
(
','
).
map
(
&
:to_sym
)
names
.
each
do
|
name
|
names
.
each
do
|
name
|
Paperclip
.
each_instance_with_attachment
(
klass
,
name
)
do
|
instance
|
Paperclip
.
each_instance_with_attachment
(
klass
,
name
)
do
|
instance
|
instance
.
send
(
name
).
reprocess!
(
*
styles
)
instance
.
send
(
name
).
reprocess!
(
*
styles
)
errors
<<
[
instance
.
id
,
instance
.
errors
]
unless
instance
.
errors
.
blank?
unless
instance
.
errors
.
blank?
puts
"
#{
instance
.
id
}
:
#{
instance
.
errors
.
full_messages
.
inspect
}
"
end
end
end
end
end
errors
.
each
{
|
e
|
puts
"
#{
e
.
first
}
:
#{
e
.
last
.
full_messages
.
inspect
}
"
}
end
end
desc
"Regenerates content_type/size metadata for a given CLASS (and optional ATTACHMENT)."
desc
"Regenerates content_type/size metadata for a given CLASS (and optional ATTACHMENT)."
...
...
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