Created
December 4, 2012 16:38
-
-
Save apneadiving/4205936 to your computer and use it in GitHub Desktop.
refactoring
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_username_as_name_if_empty | |
if self.username && self.username.present? | |
self.name = self.username if self.name && self.name.empty? | |
end | |
end | |
def set_username_as_name_if_empty | |
return if !username.blank? || !name.blank? | |
self.name = username | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment