Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove the restriction on Processor ancestry.

  • Loading branch information...
commit 6ced9eb3854f447c62d067ae2574193e4e8e7ea8 1 parent d00c04e
Mike Burns mike-burns authored
3  lib/paperclip.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
4 test/attachment_test.rb
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
4 test/paperclip_test.rb
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
Please sign in to comment.
Something went wrong with that request. Please try again.