Skip to content

Instantly share code, notes, and snippets.

@tessafallon
Forked from blake41/dog.rb
Created December 17, 2013 17:17
Show Gist options
  • Save tessafallon/8008749 to your computer and use it in GitHub Desktop.
Save tessafallon/8008749 to your computer and use it in GitHub Desktop.
require 'mysql2'
class Dog
@@db = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "dogs")
end
dog = Dog.find(10)
debugger
puts 'hi'
# color, name, id
# db
# find_by_att
# find
# insert
# update
# delete/destroy
# refactorings?
# new_from_db?
# saved?
# save! (a smart method that knows the right thing to do)
# unsaved?
# mark_saved!
# ==
# inspect
# reload
# attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment