Module: Paperdragon::Attachment::SanitizeUid

Included in:
Paperdragon::Attachment
Defined in:
lib/paperdragon/attachment.rb

Instance Method Summary collapse

Instance Method Details

#sanitize(uid) ⇒ Object



77
78
79
80
# File 'lib/paperdragon/attachment.rb', line 77

def sanitize(uid)
  #URI::encode(uid) # this is wrong, we can't send %21 in path to S3!
  uid.gsub(/(#|\?)/, "_") # escape # and ?, only.
end

#uid_from(*args) ⇒ Object



73
74
75
# File 'lib/paperdragon/attachment.rb', line 73

def uid_from(*args)
  sanitize(super)
end