Permalink
Browse files

Make Storage::S3.parse_credentials use of Rails.env optional.

Closes #389, Closes #390
  • Loading branch information...
Jason Whittle authored and sikachu committed Jan 10, 2011
1 parent 791b70d commit ff0910dc1fc75e64e7ec6dc2302308bfc856d98b
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/paperclip/storage/s3.rb
@@ -135,7 +135,8 @@ def s3_host_alias
def parse_credentials creds
creds = find_credentials(creds).stringify_keys
- (creds[Rails.env] || creds).symbolize_keys
+ env = Object.const_defined?(:Rails) ? Rails.env : nil
+ (creds[env] || creds).symbolize_keys
end
def exists?(style = default_style)

0 comments on commit ff0910d

Please sign in to comment.