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
6ced9eb3
Commit
6ced9eb3
authored
Aug 30, 2011
by
Mike Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the restriction on Processor ancestry.
parent
d00c04e3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
lib/paperclip.rb
+0
-3
test/attachment_test.rb
+4
-0
test/paperclip_test.rb
+0
-4
No files found.
lib/paperclip.rb
View file @
6ced9eb3
...
...
@@ -104,9 +104,6 @@ module Paperclip
name
=
name
.
to_s
.
camelize
load_processor
(
name
)
unless
Paperclip
.
const_defined?
(
name
)
processor
=
Paperclip
.
const_get
(
name
)
unless
processor
.
ancestors
.
include?
(
Paperclip
::
Processor
)
raise
PaperclipError
.
new
(
"Processor
#{
name
}
was not found"
)
end
processor
end
...
...
test/attachment_test.rb
View file @
6ced9eb3
...
...
@@ -447,6 +447,10 @@ class AttachmentTest < Test::Unit::TestCase
context
"An attachment with :processors that is a proc"
do
setup
do
class
Paperclip
::
Test
<
Paperclip
::
Processor
;
end
@file
=
StringIO
.
new
(
"..."
)
Paperclip
::
Test
.
stubs
(
:make
).
returns
(
@file
)
rebuild_model
:styles
=>
{
:normal
=>
''
},
:processors
=>
lambda
{
|
a
|
[
:test
]
}
@attachment
=
Dummy
.
new
.
avatar
end
...
...
test/paperclip_test.rb
View file @
6ced9eb3
...
...
@@ -25,10 +25,6 @@ class PaperclipTest < Test::Unit::TestCase
end
end
should
"raise when sent #processor and the name of a class that exists but isn't a subclass of Processor"
do
assert_raises
(
Paperclip
::
PaperclipError
){
Paperclip
.
processor
(
:attachment
)
}
end
should
"raise when sent #processor and the name of a class that doesn't exist"
do
assert_raises
(
NameError
){
Paperclip
.
processor
(
:boogey_man
)
}
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