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
12bc18d2
Commit
12bc18d2
authored
Apr 08, 2011
by
Pavel Forkert
Committed by
Jon Yurek
Apr 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowed to refresh images of classes with namespaces.
parent
7ff4120e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
README.md
+7
-0
lib/tasks/paperclip.rake
+7
-1
No files found.
README.md
View file @
12bc18d2
...
...
@@ -18,6 +18,13 @@ more detailed options.
The complete
[
RDoc
](
http://rdoc.info/gems/paperclip
)
is online.
Changes in this repo
------------
Allowed to refresh images of classes with namespaces. For example:
rake paperclip:refresh CLASS='User::Asset'
Requirements
------------
...
...
lib/tasks/paperclip.rake
View file @
12bc18d2
...
...
@@ -4,8 +4,14 @@ def obtain_class
class_name
end
def
obtain_class_from_class_name
(
class_name
)
class_name
.
split
(
'::'
).
inject
(
Object
)
do
|
klass
,
partial_class_name
|
klass
.
const_get
(
partial_class_name
)
end
end
def
obtain_attachments
(
klass
)
klass
=
Object
.
const_get
(
klass
.
to_s
)
klass
=
obtain_class_from_class_name
(
klass
.
to_s
)
name
=
ENV
[
'ATTACHMENT'
]
||
ENV
[
'attachment'
]
raise
"Class
#{
klass
.
name
}
has no attachments specified"
unless
klass
.
respond_to?
(
:attachment_definitions
)
if
!
name
.
blank?
&&
klass
.
attachment_definitions
.
keys
.
include?
(
name
)
...
...
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