Created
August 22, 2014 00:39
-
-
Save jameswritescode/ee4313c9c5ccfd28a421 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
| 42: def user_has_username?(nick) | |
| 43: result = database.execute("SELECT username FROM lastfm WHERE nick = ? LIMIT 1", [nick]) | |
| 44: | |
| => 45: binding.pry | |
| 46: | |
| 47: result.first[0] unless result.count.zero? | |
| 48: end | |
| [1] pry(Howell)> nick | |
| => "newton" | |
| [2] pry(Howell)> result | |
| => [] | |
| [3] pry(Howell)> database.execute("SELECT username FROM lastfm WHERE nick = ? LIMIT 1", ['newton']) | |
| => [["sindacious"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment