Commit c8a271eb by Jeremy Walker

Changed capitalize -> camelcase for storage module names.

parent cfe406bf
......@@ -323,7 +323,7 @@ module Paperclip
end
def initialize_storage #:nodoc:
storage_class_name = @storage.to_s.camelize
storage_class_name = @storage.to_s.downcase.camelize
begin
@storage_module = Paperclip::Storage.const_get(storage_class_name)
rescue NameError
......
......@@ -496,6 +496,19 @@ class AttachmentTest < Test::Unit::TestCase
rebuild_model :storage => :FileSystem
@dummy = Dummy.new
assert @dummy.avatar.is_a?(Paperclip::Storage::Filesystem)
rebuild_model :storage => :Filesystem
@dummy = Dummy.new
assert @dummy.avatar.is_a?(Paperclip::Storage::Filesystem)
end
should "convert underscored storage name to camelcase" do
rebuild_model :storage => :not_here
@dummy = Dummy.new
exception = assert_raises(Paperclip::StorageMethodNotFound) do |e|
@dummy.avatar
end
assert exception.message.include?("NotHere")
end
should "raise an error if you try to include a storage module that doesn't exist" do
......@@ -1061,4 +1074,4 @@ class AttachmentTest < Test::Unit::TestCase
end
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment