Created
December 22, 2009 05:58
-
-
Save billturner/261542 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
require 'rubygems' | |
require 'active_record' | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'mysql', | |
:database => 'jasons_db', | |
:username => 'root', | |
:password => 'password', | |
:host => 'localhost') | |
class Video < ActiveRecord::Base | |
# this assumes a table name videos in the jasons_db database | |
# with a primary key, auto incrementing, named id | |
end | |
Video.all.each do |video| | |
puts "This video's title is #{video.title}!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment