Created
February 8, 2009 23:02
-
-
Save r38y/60552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private | |
def generate_code | |
1.times do | |
self.code, self.phonetic_code = *Nerd.generate_code(badge.identifier) | |
redo if Code.count(:conditions => ['code = ?', self.code]) > 0 | |
end | |
end | |
private | |
# probably better | |
def generate_code | |
self.code, self.phonetic_code = *Nerd.generate_code(badge.identifier) | |
generate_code if Code.count(:conditions => ['code = ?', self.code]) > 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment