Created
October 11, 2016 00:06
-
-
Save dylanerichards/009f954ccb3ab20ea0ce2030e003bef0 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 find(id) | |
cmd = `sqlite3 test "select * from things where id = #{id}"` | |
end | |
def all | |
users_array = [] | |
users = `sqlite3 test "select * from things;"`.split("\n") | |
users.each { |user| users_array << user } | |
users_array | |
end | |
def first | |
all.first | |
end | |
def last | |
all.last | |
end | |
p last |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment