Last active
October 18, 2016 00:53
-
-
Save thomasmarren/b2c79d960d55a2ef75cff82d0b86ed07 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
#Ruby | |
def self.delete_by_name(name) | |
sql = "DELETE FROM users WHERE name = ?" | |
DB[:conn].execute(sql,name) | |
end | |
#Active Record | |
user = User.find_by(name: 'David') | |
user.destroy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment