Permalink
Browse files

WIP: Path and URL in storage module.

  • Loading branch information...
1 parent 4f85dd4 commit 6868ff952a61a80b30ebb61adf9ba75005bb9cb3 @jyurek jyurek committed Aug 18, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/paperclip/attachment.rb
@@ -274,13 +274,14 @@ def valid_assignment? file #:nodoc:
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

0 comments on commit 6868ff9

Please sign in to comment.