lib/scribd_fu/paperclip.rb in scribd_fu-2.0.6 vs lib/scribd_fu/paperclip.rb in scribd_fu-2.0.7
- old
+ new
@@ -26,10 +26,12 @@
# Returns the full filename for the given attribute. If the file is
# stored on S3, this is a full S3 URI, while it is a full path to the
# local file if the file is stored locally.
def file_path
- attached_file.url =~ ScribdFu::S3 ? attached_file.url : attached_file.path
+ path = (attached_file.url =~ ScribdFu::S3) ? attached_file.url : attached_file.path
+ pos = path.rindex('?')
+ (pos) ? path[0, pos] : path
end
private