Permalink
Browse files

Fixing false assumption that users are running Rails 2.x

  • Loading branch information...
1 parent f09aeea commit 4238a28ac6cc9e3b37b1079ae41b634e5b9d6f8b Andrew Kolesnikov committed Apr 19, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/dm-paperclip/storage.rb
@@ -173,9 +173,10 @@ def parse_credentials creds
creds = find_credentials(creds).to_mash
if defined? Merb && Merb.respond_to?(:env)
creds[Merb.env] || creds
- elsif defined? RAILS_ENV
-
+ elsif defined? RAILS_ENV
creds[RAILS_ENV] || creds
+ elsif defined? Rails && Rails.respond_to(:env)
+ creds[Rails.env] || creds
elsif defined? RACK_ENV
creds[RACK_ENV] || creds
else

0 comments on commit 4238a28

Please sign in to comment.