Created
November 7, 2011 03:17
-
-
Save wrburgess/1344105 to your computer and use it in GitHub Desktop.
concatenate a user model first and last name
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
# concatenate a user model's first and last name, include middle name or suffix if required | |
# may consider abbreviating the middle name | |
def fullname | |
if middlename.nil? then | |
fullname = firstname + ' ' + lastname | |
else | |
fullname = firstname + ' ' + middlename + ' ' + lastname | |
end | |
unless suffix.nil? then | |
fullname = fullname + ' ' + suffix | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment