Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't require storage module files directly.

  • Loading branch information...
commit 5e4dcb4d79528c96979d5d0082ca75a218e882d8 1 parent a9ac0f8
Jon Yurek jyurek authored
1  lib/paperclip.rb
View
@@ -37,6 +37,7 @@
require 'paperclip/interpolations'
require 'paperclip/style'
require 'paperclip/attachment'
+require 'paperclip/storage'
require 'paperclip/callback_compatability'
require 'paperclip/command_line'
require 'paperclip/railtie'
8 lib/paperclip/attachment.rb
View
@@ -275,13 +275,11 @@ def valid_assignment? file #:nodoc:
def initialize_storage #:nodoc:
storage_class_name = @storage.to_s.capitalize
- storage_file_name = @storage.to_s.downcase
begin
- require "paperclip/storage/#{storage_file_name}"
- rescue MissingSourceFile
- raise StorageMethodNotFound, "Cannot load 'paperclip/storage/#{storage_file_name}'"
+ @storage_module = Paperclip::Storage.const_get(storage_class_name)
+ rescue NameError
+ raise StorageMethodNotFound, "Cannot load storage module '#{storage_class_name}'"
end
- @storage_module = Paperclip::Storage.const_get(storage_class_name)
self.extend(@storage_module)
end
2  lib/paperclip/storage.rb
View
@@ -0,0 +1,2 @@
+require "paperclip/storage/filesystem"
+require "paperclip/storage/s3"
Please sign in to comment.
Something went wrong with that request. Please try again.