Commit 6868ff95 by Jon Yurek

WIP: Path and URL in storage module.

parent 4f85dd44
......@@ -274,13 +274,14 @@ module Paperclip
end
def initialize_storage #:nodoc:
storage_name = @storage.to_s.capitalize
storage_class_name = @storage.to_s.capitalize
storage_file_name = @storage.to_s.downcase
begin
require "paperclip/storage/#{@storage}"
require "paperclip/storage/#{storage_file_name}"
rescue MissingSourceFile
raise StorageMethodNotFound, "Cannot find the '#{@storage}' storage adapter."
raise StorageMethodNotFound, "Cannot load 'paperclip/storage/#{storage_file_name}'"
end
@storage_module = Paperclip::Storage.const_get(storage_name)
@storage_module = Paperclip::Storage.const_get(storage_class_name)
self.extend(@storage_module)
end
......
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