Skip to content

Commit abb6c40

Browse files
author
Tobi Knaup
committed
Don't require aws/s3 if it's already loaded.
1 parent a9ac0f8 commit abb6c40

File tree

1 file changed

+7
-5
lines changed
  • lib/paperclip/storage

1 file changed

+7
-5
lines changed

lib/paperclip/storage/s3.rb

+7-5
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ module Storage
5858
# separate parts of your file name.
5959
module S3
6060
def self.extended base
61-
begin
62-
require 'aws/s3'
63-
rescue LoadError => e
64-
e.message << " (You may need to install the aws-s3 gem)"
65-
raise e
61+
unless defined?(AWS::S3)
62+
begin
63+
require 'aws/s3'
64+
rescue LoadError => e
65+
e.message << " (You may need to install the aws-s3 gem)"
66+
raise e
67+
end
6668
end
6769

6870
base.instance_eval do

0 commit comments

Comments
 (0)