Guest User

Untitled

a guest
Apr 26th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. require 'rubygems'
  2. require 'active_record'
  3.  
  4. ActiveRecord::Base.logger = Logger.new(STDOUT)
  5. ActiveRecord::Base.establish_connection(
  6. :adapter => 'mysql',
  7. :database => 'jasons_db',
  8. :username => 'root',
  9. :password => 'password',
  10. :host => 'localhost')
  11.  
  12. class Video < ActiveRecord::Base
  13. # this assumes a table name videos in the jasons_db database
  14. # with a primary key, auto incrementing, named id
  15. end
  16.  
  17. Video.all.each do |video|
  18. puts "This video's title is #{video.title}!"
  19. end
Add Comment
Please, Sign In to add comment