]> nos-oignons.net Git - gestion-adh.git/commitdiff
Enable Member#filename_for_id to work with strings
authorLunar <lunar@anargeek.net>
Fri, 7 Jun 2013 13:02:25 +0000 (15:02 +0200)
committerLunar <lunar@anargeek.net>
Fri, 7 Jun 2013 13:02:25 +0000 (15:02 +0200)
lib/nos_oignons/member.rb

index a67581c114ea6d06588e5442d8c8ffe53f676bf8..32d32f70ed500009c9b67d04b4fb8e8537e40157 100644 (file)
@@ -35,7 +35,12 @@ module NosOignons
       end
 
       def filename_for_id(member_id)
       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)
       end
 
       def read_from_git(ref, file)