Top Level Namespace
Defined Under Namespace
Instance Method Summary collapse
-
#id_partition ⇒ Object
the id of mongoid is not integer, correct the id_partitioin.
Instance Method Details
#id_partition ⇒ Object
the id of mongoid is not integer, correct the id_partitioin.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/mongoid_paperclip.rb', line 5 Paperclip.interpolates :id_partition do |, style| case id = .instance.id when Integer ("%09d".freeze % id).scan(/\d{3}/).join("/".freeze) when String id.scan(/.{4}/).join("/".freeze) else nil end end |