From: Lunar Date: Fri, 7 Jun 2013 13:02:25 +0000 (+0200) Subject: Enable Member#filename_for_id to work with strings X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/commitdiff_plain/6257d0524bfb1247f04538b9fde2a7ddb7b15d2a Enable Member#filename_for_id to work with strings --- diff --git a/lib/nos_oignons/member.rb b/lib/nos_oignons/member.rb index a67581c..32d32f7 100644 --- a/lib/nos_oignons/member.rb +++ b/lib/nos_oignons/member.rb @@ -35,7 +35,12 @@ module NosOignons end def filename_for_id(member_id) - "#{NosOignons::Member.db_path}/%06d.mdwn" % member_id + case member_id + when String + "#{NosOignons::Member.db_path}/#{member_id}.mdwn" + when Integer + "#{NosOignons::Member.db_path}/%06d.mdwn" % member_id + end end def read_from_git(ref, file)