id_partition doesn't work with mongodb #757

ikonyshev opened this Issue Feb 27, 2012 · 1 comment


None yet

2 participants


according to code below (it's from interpolations.rb) id_partition function return nil for mongo ids because mongo use own id class. I think it would be great to convert id to string using .to_s to avoid such problems.
Also it seems that taking only first 3 matches for string ids can cause problems (for example my project is going to have 200-300k items with up to 30 images per item, and these 3 matches wouldn't help at all)

    def id_partition attachment, style_name
      case id =
      when Integer
        ("%09d" % id).scan(/\d{3}/).join("/")
      when String
sikachu commented Mar 2, 2012

Yeah, I think for mongo you'll have to write the id_partition interpolation yourself, and override the one given by paperclip.

@sikachu sikachu closed this Mar 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment