Created
October 26, 2015 03:04
-
-
Save billy3321/91452084a345e415214a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def set_avatar | |
if avatar.blank? | |
if gender == 'male' | |
avatar = File.open(Dir['male/*'].sample) | |
elsif gender == 'female' | |
avatar = File.open(Dir['female/*'].sample) | |
else | |
avatar = File.open(Dir['male/*', 'female/*'].sample) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment