Created
September 17, 2010 18:05
-
-
Save x37v/584651 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
def check_username_is_allowed | |
RESTRICTED_NAMES.each do |restricted| | |
- errors.add(:username, "is not available") if | |
- username =~ /#{restricted}/i unless errors.on(:username) | |
+ errors[:username] << "is not available" if | |
+ username =~ /#{restricted}/i unless errors[:username] and errors[:username].size != 0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment