Browse files

Revise `:respond_to?` duck typing check

Actually trying to check what's being used in the method instead of
checking for something and use another thing. Thanks @jferris.
  • Loading branch information...
1 parent 5840b75 commit 6003e543a958cbf0a21d5285c352ba00483094f5 @sikachu sikachu committed Jun 8, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/paperclip/storage/s3.rb
View
5 lib/paperclip/storage/s3.rb
@@ -249,9 +249,8 @@ def http_proxy_password
end
def set_permissions permissions
- permissions = { :default => permissions } unless permissions.respond_to?(:merge)
- permissions[:default] ||= :public_read
- permissions
+ permissions = { :default => permissions } unless permissions.respond_to?(:reverse_merge)
+ permissions.reverse_merge :default => :public_read
end
def parse_credentials creds

0 comments on commit 6003e54

Please sign in to comment.