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
7832694f
Commit
7832694f
authored
May 13, 2008
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the rake task.
parent
d177c8f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tasks/paperclip_tasks.rake
+4
-3
No files found.
tasks/paperclip_tasks.rake
View file @
7832694f
...
...
@@ -6,8 +6,8 @@ end
def
obtain_attachments
name
=
ENV
[
'ATTACHMENT'
]
||
ENV
[
'attachment'
]
raise
"Class
#{
@klass
.
name
}
has no attachments specified"
unless
@klass
.
respond_to?
(
:attachment_
name
s
)
if
!
name
.
blank?
&&
@klass
.
attachment_
name
s
.
include?
(
name
)
raise
"Class
#{
@klass
.
name
}
has no attachments specified"
unless
@klass
.
respond_to?
(
:attachment_
definition
s
)
if
!
name
.
blank?
&&
@klass
.
attachment_
definitions
.
key
s
.
include?
(
name
)
[
name
]
else
@klass
.
attachment_definitions
.
keys
...
...
@@ -19,9 +19,10 @@ namespace :paperclip do
task
:refresh
=>
:environment
do
klass
=
obtain_class
names
=
obtain_attachments
instances
=
klass
.
find
(
:all
)
puts
"Regenerating thumbnails for
#{
instances
.
length
}
instances of
#{
klass
.
name
}
:"
klass
.
find
(
:all
)
.
each
do
|
instance
|
instances
.
each
do
|
instance
|
names
.
each
do
|
name
|
result
=
if
instance
.
send
(
"
#{
name
}
?"
)
instance
.
send
(
name
).
send
(
"post_process"
)
...
...
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