Forum: Ruby on Rails Re: attachment_fu File System Storage Change - Update?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2007-04-10 03:10
(Received via mailing list)

Thanks a ton for this. I just realized this response was sitting in my
spam folder and I've since re-sent the question to the list so please
ignore those. Whoops.

This looks good - I will give it a go.

Thanks again for this and the great plug-in!

Walter McGinnis (Guest)
on 2007-06-18 07:33
(Received via mailing list)
Unfortunately I had a lot of links pointing back at legacy paths.
Here's my middleground solution that I think allows me to move forward
with the new scheme for paths while not having to move my old files:

# workaround for legacy attachments
    if LEGACY_IMAGE_FILE_PATHS_UP_TO.nil? or attachment_path_id.to_i >
      ("%08d" % attachment_path_id).scan(/..../) + args
      [attachment_path_id.to_s] + args

I've got about 10k existing image files with ids up to about 49081,
since the new scheme starts creating directories at 0000, I doubt I'll
see any directory names that will collide.  I must admit to being lazy
in the math department.  Am I missing anything?

This topic is locked and can not be replied to.