Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

object id more than 8 digits #1

@yebihara

Description

@yebihara

Hi,

I found the lines as below in file_column.rb:

def relative_path_prefix
  raise RuntimeError.new("Trying to access file_column, but primary key got lost.") if @instance.id.to_s.empty?
  File.join(*("%08d" % @instance.id).scan(/..../))
end

The id of my object with file_column gets more than 8 digits and the directory paths sometimes conflict because of this.

irb(main):023:0> ("%08d" % 12345678).scan(/..../)
=> ["1234", "5678"]
irb(main):024:0> ("%08d" % 123456789).scan(/..../)
=> ["1234", "5678"]
irb(main):025:0> ("%08d" % 1234567890).scan(/..../)
=> ["1234", "5678"]
irb(main):026:0> ("%08d" % 12345678901).scan(/..../)
=> ["1234", "5678"]
irb(main):027:0> ("%08d" % 123456789012).scan(/..../)
=> ["1234", "5678", "9012"]

Could you resolve this issue?

Thanks,

ebi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions