Permalink
Browse files

Remove the restriction on Processor ancestry.

  • Loading branch information...
1 parent d00c04e commit 6ced9eb3854f447c62d067ae2574193e4e8e7ea8 @mike-burns mike-burns committed Aug 30, 2011
Showing with 4 additions and 7 deletions.
  1. +0 −3 lib/paperclip.rb
  2. +4 −0 test/attachment_test.rb
  3. +0 −4 test/paperclip_test.rb
View
@@ -104,9 +104,6 @@ def processor name #:nodoc:
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
View
@@ -447,6 +447,10 @@ def thumb; "-thumb"; end
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
View
@@ -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

0 comments on commit 6ced9eb

Please sign in to comment.